Don't store band text if "" is passed into SetBandInfo.

oldstable
Robert Shearman 2003-10-24 04:18:42 +00:00 committed by Alexandre Julliard
parent 5454282946
commit fad1e1108e
1 changed files with 10 additions and 4 deletions

View File

@ -3402,8 +3402,11 @@ REBAR_SetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
if (lprbbi->lpText) { if (lprbbi->lpText) {
INT len = MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, NULL, 0 ); INT len = MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, NULL, 0 );
lpBand->lpText = (LPWSTR)Alloc (len*sizeof(WCHAR)); if (len > 1)
MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, lpBand->lpText, len ); {
lpBand->lpText = (LPWSTR)Alloc (len*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, lpBand->lpText, len );
}
} }
} }
@ -3447,8 +3450,11 @@ REBAR_SetBandInfoW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
if (lprbbi->lpText) { if (lprbbi->lpText) {
INT len = lstrlenW (lprbbi->lpText); INT len = lstrlenW (lprbbi->lpText);
lpBand->lpText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); if (len > 0)
strcpyW (lpBand->lpText, lprbbi->lpText); {
lpBand->lpText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR));
strcpyW (lpBand->lpText, lprbbi->lpText);
}
} }
} }