Commit a1edb920 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

TB_ADDBUTTONS can pass a string ptr instead of an index.

TB_GETBUTTONINFO only returns a string if it's not in the internal string list.
parent e0e31478
......@@ -2473,6 +2473,9 @@ TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr->fsState = lpTbb[nCount].fsState;
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
btnPtr->dwData = lpTbb[nCount].dwData;
if(HIWORD(lpTbb[nCount].iString) && lpTbb[nCount].iString != -1)
Str_SetPtrAtoW ((LPWSTR*)&btnPtr->iString, (LPSTR)lpTbb[nCount].iString );
else
btnPtr->iString = lpTbb[nCount].iString;
btnPtr->bHot = FALSE;
......@@ -2537,6 +2540,9 @@ TOOLBAR_AddButtonsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
btnPtr->fsState = lpTbb[nCount].fsState;
btnPtr->fsStyle = lpTbb[nCount].fsStyle;
btnPtr->dwData = lpTbb[nCount].dwData;
if(HIWORD(lpTbb[nCount].iString) && lpTbb[nCount].iString != -1)
Str_SetPtrW ((LPWSTR*)&btnPtr->iString, (LPWSTR)lpTbb[nCount].iString );
else
btnPtr->iString = lpTbb[nCount].iString;
btnPtr->bHot = FALSE;
......@@ -3148,8 +3154,14 @@ TOOLBAR_GetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpTbInfo->dwMask & TBIF_STYLE)
lpTbInfo->fsStyle = btnPtr->fsStyle;
if (lpTbInfo->dwMask & TBIF_TEXT) {
LPWSTR lpText = TOOLBAR_GetText(infoPtr,btnPtr);
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
can't use TOOLBAR_GetText here */
LPWSTR lpText;
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
lpText = (LPWSTR)btnPtr->iString;
Str_GetPtrWtoA (lpText, lpTbInfo->pszText,lpTbInfo->cchText);
} else
lpTbInfo->pszText[0] = '\0';
}
return nIndex;
}
......@@ -3193,8 +3205,14 @@ TOOLBAR_GetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpTbInfo->dwMask & TBIF_STYLE)
lpTbInfo->fsStyle = btnPtr->fsStyle;
if (lpTbInfo->dwMask & TBIF_TEXT) {
LPWSTR lpText = TOOLBAR_GetText(infoPtr,btnPtr);
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
can't use TOOLBAR_GetText here */
LPWSTR lpText;
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
lpText = (LPWSTR)btnPtr->iString;
Str_GetPtrW (lpText,lpTbInfo->pszText,lpTbInfo->cchText);
} else
lpTbInfo->pszText[0] = '\0';
}
return nIndex;
......
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