Stop TOOLBAR_MeasureString from dying on empty strings.

This commit is contained in:
Charles Duffy 2002-02-26 00:34:19 +00:00 committed by Alexandre Julliard
parent 770a5bfa2d
commit 6a45c0b4b4
1 changed files with 14 additions and 12 deletions

View File

@ -819,6 +819,7 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
{
LPWSTR lpText = TOOLBAR_GetText(infoPtr, btnPtr);
if(lpText != NULL) {
/* first get size of all the text */
GetTextExtentPoint32W (hdc, lpText, strlenW (lpText), lpSize);
@ -836,6 +837,7 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
lpSize->cx = myrect.right;
lpSize->cy = myrect.bottom;
}
}
TRACE("string size %ld x %ld!\n", lpSize->cx, lpSize->cy);
}