Module: wine Branch: master Commit: 8ef79b023a06f00ca6ab37afb8089d358b277d73 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ef79b023a06f00ca6ab37afb8...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue May 9 22:11:56 2017 +0300
comctl32/listview: Convert item text once when looking for insertion point.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comctl32/listview.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index acafbd3..70a6e6d 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -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