mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:42:57 +00:00
STATUSBAR_SetTextT:
-ntext wasn't freed on return if text was unicode -part->text was allways freed, but if the previous style was SBT_OWNERDRAW, part->text would contain 32bit data (not a buffer ptr.) svn path=/trunk/; revision=12104
This commit is contained in:
parent
43ca7fca1f
commit
241ac18672
1 changed files with 4 additions and 2 deletions
|
@ -650,6 +650,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
||||||
{
|
{
|
||||||
STATUSWINDOWPART *part=NULL;
|
STATUSWINDOWPART *part=NULL;
|
||||||
BOOL changed = FALSE;
|
BOOL changed = FALSE;
|
||||||
|
WORD oldStyle;
|
||||||
|
|
||||||
if (style & SBT_OWNERDRAW) {
|
if (style & SBT_OWNERDRAW) {
|
||||||
TRACE("part %d, text %p\n",nPart,text);
|
TRACE("part %d, text %p\n",nPart,text);
|
||||||
|
@ -671,6 +672,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
||||||
if (part->style != style)
|
if (part->style != style)
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
|
|
||||||
|
oldStyle = part->style;
|
||||||
part->style = style;
|
part->style = style;
|
||||||
if (style & SBT_OWNERDRAW) {
|
if (style & SBT_OWNERDRAW) {
|
||||||
if (part->text == text)
|
if (part->text == text)
|
||||||
|
@ -694,7 +696,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
||||||
/* check if text is unchanged -> no need to redraw */
|
/* check if text is unchanged -> no need to redraw */
|
||||||
if (text) {
|
if (text) {
|
||||||
if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
|
if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
|
||||||
if (!isW) Free(ntext);
|
Free(ntext);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -702,7 +704,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part->text)
|
if (part->text && !(oldStyle & SBT_OWNERDRAW))
|
||||||
Free (part->text);
|
Free (part->text);
|
||||||
part->text = ntext;
|
part->text = ntext;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue