Commit a79cc39f authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>

Fixes a problem when using STATUSBAR_SetText() to toggle SBT_OWNERDRAW
parent 49080d3b
......@@ -647,20 +647,22 @@ STATUSBAR_SetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
part = &self->parts[part_num];
if (!part) return FALSE;
part->style = style;
if (!(part->style & SBT_OWNERDRAW) && part->text)
COMCTL32_Free (part->text);
part->text = 0;
if (style & SBT_OWNERDRAW) {
part->text = (LPWSTR)text;
}
else {
/* duplicate string */
if (part->text)
COMCTL32_Free (part->text);
part->text = 0;
if (text && (len = lstrlenA(text))) {
part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyAtoW (part->text, text);
}
}
part->style = style;
hdc = GetDC (hwnd);
STATUSBAR_RefreshPart (hwnd, part, hdc);
......@@ -688,20 +690,22 @@ STATUSBAR_SetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
else
part = &self->parts[part_num];
if (!part) return FALSE;
part->style = style;
if (!(part->style & SBT_OWNERDRAW) && part->text)
COMCTL32_Free (part->text);
part->text = 0;
if (style & SBT_OWNERDRAW) {
part->text = text;
}
else {
/* duplicate string */
if (part->text)
COMCTL32_Free (part->text);
part->text = 0;
if (text && (len = lstrlenW(text))) {
part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW(part->text, text);
}
}
part->style = style;
hdc = GetDC (hwnd);
STATUSBAR_RefreshPart (hwnd, part, hdc);
......
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