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);
|
||||
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 @@ TOOLBAR_GetButtonTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
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…
Reference in New Issue