[Bug 42602] New: ::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct) bad sort compared to Windows

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Mar 7 07:22:55 CST 2017


https://bugs.winehq.org/show_bug.cgi?id=42602

            Bug ID: 42602
           Summary: ::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct)
                    bad sort compared to Windows
           Product: Wine
           Version: 2.3
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: user32
          Assignee: wine-bugs at winehq.org
          Reporter: martin at hinner.info
      Distribution: ---

Let's have this MFC code:

class CIconListBox : public CListBox

...

int CIconListBox::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct)
{ 
    CIconListBoxItem *Item1;
    CIconListBoxItem *Item2;

    Item1=(CIconListBoxItem *)lpCompareItemStruct->itemData1;
    Item2=LastItem;

    /*
    CompateItem is called immediately after AddString which does not contain
any info for sorting. Pointer to data is set after AddString by calling
SetItemDataPtr.
    This function thus relies on undocumented fact that Item2 is always last
added item.
    Item1 has correct pointer..
    */

    //Item2=(CIconListBoxItem *)lpCompareItemStruct->itemData2;

    //nejdriv rozhodne priorita
    if (Item1->m_sortprior>Item2->m_sortprior)
        return -1;
    if (Item1->m_sortprior<Item2->m_sortprior)
        return 1;

    if (wcscmp(Item1->m_szItemName,Item2->m_szItemName)>0)
        return 1;
    else return -1;
}


Result in Windows: sorted OK
Result in Wine: reverse sorted.

I can provide app for testing. It is http://obdtester.com/downloads (e.g.
BimCOM), password for download upon request by individual e-mail.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list