Commit 8ef79b02 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Convert item text once when looking for insertion point.

parent d3d8d4f3
......@@ -7824,18 +7824,24 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
HDPA hItem;
ITEM_INFO *item_s;
INT i = 0, cmpv;
WCHAR *textW;
textW = textdupTtoW(lpLVItem->pszText, isW);
while (i < infoPtr->nItemCount)
{
hItem = DPA_GetPtr( infoPtr->hdpaItems, i);
item_s = DPA_GetPtr(hItem, 0);
cmpv = textcmpWT(item_s->hdr.pszText, lpLVItem->pszText, isW);
cmpv = textcmpWT(item_s->hdr.pszText, textW, TRUE);
if (infoPtr->dwStyle & LVS_SORTDESCENDING) cmpv *= -1;
if (cmpv >= 0) break;
i++;
}
textfreeT(textW, isW);
nItem = i;
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment