Handle case when item text is empty.
According to MSDN, length should be returned when lParam is NULL.
This commit is contained in:
parent
ed3d86f9be
commit
0178c1116b
@ -3297,9 +3297,7 @@ TOOLBAR_GetButtonTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||||
INT nIndex;
|
INT nIndex;
|
||||||
LPWSTR lpText;
|
LPWSTR lpText;
|
||||||
|
LRESULT ret = 0;
|
||||||
if (lParam == 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
|
||||||
if (nIndex == -1)
|
if (nIndex == -1)
|
||||||
@ -3307,9 +3305,15 @@ TOOLBAR_GetButtonTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
|
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
|
||||||
|
|
||||||
strcpyW ((LPWSTR)lParam, lpText);
|
if (lpText)
|
||||||
|
{
|
||||||
|
ret = strlenW (lpText);
|
||||||
|
|
||||||
return strlenW (lpText);
|
if (lParam)
|
||||||
|
strcpyW ((LPWSTR)lParam, lpText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user