Module: wine Branch: master Commit: 10d3ea30b766aa63ed9590a1a90ac913b9875f70 URL: http://source.winehq.org/git/wine.git/?a=commit;h=10d3ea30b766aa63ed9590a1a9...
Author: Lei Zhang thestig@google.com Date: Wed Oct 29 01:58:46 2008 -0700
comctl32: Don't notify if listview edit box contents have not changed.
---
dlls/comctl32/listview.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index d218a5c..ad48403 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4833,15 +4833,28 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, LPWSTR pszText, BOOL { HWND hwndSelf = infoPtr->hwndSelf; NMLVDISPINFOW dispInfo; + BOOL bSame;
TRACE("(pszText=%s, isW=%d)\n", debugtext_t(pszText, isW), isW);
ZeroMemory(&dispInfo, sizeof(dispInfo)); - dispInfo.item.mask = LVIF_PARAM | LVIF_STATE; + dispInfo.item.mask = LVIF_PARAM | LVIF_STATE | LVIF_TEXT; dispInfo.item.iItem = infoPtr->nEditLabelItem; dispInfo.item.iSubItem = 0; dispInfo.item.stateMask = ~0; if (!LISTVIEW_GetItemW(infoPtr, &dispInfo.item)) return FALSE; + + /* Don't bother continuing if text has not changed */ + if (isW) + bSame = (lstrcmpW(dispInfo.item.pszText, pszText) == 0); + else + { + LPWSTR tmp = textdupTtoW(pszText, FALSE); + bSame = (lstrcmpW(dispInfo.item.pszText, tmp) == 0); + textfreeT(tmp, FALSE); + } + if (bSame) return TRUE; + /* add the text from the edit in */ dispInfo.item.mask |= LVIF_TEXT; dispInfo.item.pszText = pszText;