Don't store band text if "" is passed into SetBandInfo.
This commit is contained in:
parent
5454282946
commit
fad1e1108e
|
@ -3402,10 +3402,13 @@ 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 );
|
||||||
|
if (len > 1)
|
||||||
|
{
|
||||||
lpBand->lpText = (LPWSTR)Alloc (len*sizeof(WCHAR));
|
lpBand->lpText = (LPWSTR)Alloc (len*sizeof(WCHAR));
|
||||||
MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, lpBand->lpText, len );
|
MultiByteToWideChar( CP_ACP, 0, lprbbi->lpText, -1, lpBand->lpText, len );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
REBAR_ValidateBand (infoPtr, lpBand);
|
REBAR_ValidateBand (infoPtr, lpBand);
|
||||||
|
|
||||||
|
@ -3447,10 +3450,13 @@ 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);
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
lpBand->lpText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR));
|
lpBand->lpText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR));
|
||||||
strcpyW (lpBand->lpText, lprbbi->lpText);
|
strcpyW (lpBand->lpText, lprbbi->lpText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
REBAR_ValidateBand (infoPtr, lpBand);
|
REBAR_ValidateBand (infoPtr, lpBand);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue