mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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;
|
||||
BOOL changed = FALSE;
|
||||
WORD oldStyle;
|
||||
|
||||
if (style & SBT_OWNERDRAW) {
|
||||
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)
|
||||
changed = TRUE;
|
||||
|
||||
oldStyle = part->style;
|
||||
part->style = style;
|
||||
if (style & SBT_OWNERDRAW) {
|
||||
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 */
|
||||
if (text) {
|
||||
if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
|
||||
if (!isW) Free(ntext);
|
||||
Free(ntext);
|
||||
return TRUE;
|
||||
}
|
||||
} else {
|
||||
|
@ -702,7 +704,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (part->text)
|
||||
if (part->text && !(oldStyle & SBT_OWNERDRAW))
|
||||
Free (part->text);
|
||||
part->text = ntext;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue