toolbar: TOOLBAR_GetButtonTextW
Ulrich Czekalla
ulrich.czekalla at utoronto.ca
Wed Jun 2 10:53:03 CDT 2004
ChangeLog:
Ulrich Czekalla <ulrich at codeweavers.com>
Handle case when item text is empty.
According to MSDN, length should be returned when lParam is NULL.
-------------- next part --------------
Index: dlls/comctl32/toolbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/toolbar.c,v
retrieving revision 1.178
diff -u -r1.178 toolbar.c
--- dlls/comctl32/toolbar.c 2 Jun 2004 00:36:00 -0000 1.178
+++ dlls/comctl32/toolbar.c 2 Jun 2004 15:42:33 -0000
@@ -3297,9 +3297,7 @@
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
LPWSTR lpText;
-
- if (lParam == 0)
- return -1;
+ LRESULT ret = 0;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
if (nIndex == -1)
@@ -3307,9 +3305,15 @@
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
- strcpyW ((LPWSTR)lParam, lpText);
+ if (lpText)
+ {
+ ret = strlenW (lpText);
+
+ if (lParam)
+ strcpyW ((LPWSTR)lParam, lpText);
+ }
- return strlenW (lpText);
+ return ret;
}
More information about the wine-patches
mailing list