http://bugs.winehq.org/show_bug.cgi?id=20742
Summary: Sorted list view control always inserts at the end Product: Wine Version: 1.1.31 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: nakamoto2@users.sourceforge.net
In a sorted list view control, in report mode, InsertItemA always inserts at the end instead of the correctly sorted location.
In my test case, the values being sorted always start with the same character, such as: 0010 0020 0030 0040
If 0025 is inserted, it will be inserted at the end. It doesn't matter if the list is sorted ascending or descending.
I think it's because this line of code is comparing the internal wide-char string with the passed in single-width char string without converting it:
on line 7221 of dlls\comctl32\listview.c cmpv = textcmpWT(item_s->hdr.pszText, lpLVItem->pszText, TRUE);
shouldn't TRUE be changed to isW? cmpv = textcmpWT(item_s->hdr.pszText, lpLVItem->pszText, isW);
It was working correctly in version 1.1.20 and 1.0.1.