#19194: Generic wxDataViewCtrl uses wrong sort logic

15 views
Skip to first unread message

wxTrac

unread,
Jun 3, 2021, 2:37:41 PM6/3/21
to wx-...@googlegroups.com
#19194: Generic wxDataViewCtrl uses wrong sort logic
-------------------------+--------------------
Reporter: afalkenhahn | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.1.5
Keywords: | Blocked By:
Blocking: | Patch: 1
-------------------------+--------------------
When changing the value of an item, `PutChildInSortOrder()` is called to
make sure that the item is moved into the correct position. This seems to
use some incorrect optimization that only compares the item with the
previous item to determine if the item position has changed. This is
obviously not enough. We also need to compare the item with the following
item to make sure that the item position hasn't changed.

I'm attaching a fix for the bug.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19194>

wxTrac

unread,
Jun 3, 2021, 2:38:04 PM6/3/21
to wx-...@googlegroups.com
#19194: Generic wxDataViewCtrl uses wrong sort logic
--------------------------+-------------------
Reporter: afalkenhahn | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.1.5
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 1 |
--------------------------+-------------------
Changes (by afalkenhahn):

* Attachment "mypatch.patch" added.

wxTrac

unread,
Jun 10, 2021, 6:18:35 PM6/10/21
to wx-...@googlegroups.com
#19194: Generic wxDataViewCtrl uses wrong sort logic
--------------------------+-------------------
Reporter: afalkenhahn | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.1.5
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 1 |
--------------------------+-------------------

Comment (by vadz):

Thanks, I've applied this, but it would be really great to have this
covered by some tests to avoid breaking it again in the future. If anybody
has any time to work on this, it would be time very well spent IMHO.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19194#comment:1>

wxTrac

unread,
Jun 10, 2021, 6:49:12 PM6/10/21
to wx-...@googlegroups.com
#19194: Generic wxDataViewCtrl uses wrong sort logic
--------------------------+-------------------------------------
Reporter: afalkenhahn | Owner: Vadim Zeitlin <vadim@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: GUI-generic | Version: 3.1.5
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Patch: 1 |
--------------------------+-------------------------------------
Changes (by Vadim Zeitlin <vadim@…>):

* owner: => Vadim Zeitlin <vadim@…>
* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"527bcb246bb1d82695417e9b68a728c2f9185f79/git-wxWidgets"
527bcb246/git-wxWidgets]:
{{{
#!CommitTicketReference repository="git-wxWidgets"
revision="527bcb246bb1d82695417e9b68a728c2f9185f79"
Fix item position in sorted generic wxDataViewCtrl

Compare the item whose value has changed with both the previous and the
next items, if any.

Closes #19194.
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19194#comment:2>
Reply all
Reply to author
Forward
0 new messages