Commit 0178c111 authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Handle case when item text is empty.

According to MSDN, length should be returned when lParam is NULL.
parent ed3d86f9
......@@ -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]);
if (lpText)
{
ret = strlenW (lpText);
if (lParam)
strcpyW ((LPWSTR)lParam, lpText);
}
return strlenW (lpText);
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment