Commit 793f9a51 authored by Krzysztof Foltman's avatar Krzysztof Foltman Committed by Alexandre Julliard

- Style trace information is written to different debug channel (it's

not very useful anymore, reference counting looks correct for now). - The document dump contains the character position of the end-of-text mark.
parent 85155cc6
...@@ -181,7 +181,7 @@ void ME_DumpDocument(ME_TextBuffer *buffer) ...@@ -181,7 +181,7 @@ void ME_DumpDocument(ME_TextBuffer *buffer)
pItem->member.run.nCharOfs); pItem->member.run.nCharOfs);
break; break;
case diTextEnd: case diTextEnd:
TRACE("\nEnd\n"); TRACE("\nEnd(ofs=%d)\n", pItem->member.para.nCharOfs);
break; break;
default: default:
break; break;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "editor.h" #include "editor.h"
WINE_DEFAULT_DEBUG_CHANNEL(richedit); WINE_DEFAULT_DEBUG_CHANNEL(richedit);
WINE_DECLARE_DEBUG_CHANNEL(richedit_style);
static int all_refs = 0; static int all_refs = 0;
...@@ -197,7 +198,7 @@ void ME_DumpStyle(ME_Style *s) ...@@ -197,7 +198,7 @@ void ME_DumpStyle(ME_Style *s)
{ {
char buf[2048]; char buf[2048];
ME_DumpStyleToBuf(&s->fmt, buf); ME_DumpStyleToBuf(&s->fmt, buf);
TRACE("%s\n", buf); TRACE_(richedit_style)("%s\n", buf);
} }
void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
...@@ -321,7 +322,7 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s) ...@@ -321,7 +322,7 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s)
if (i < HFONT_CACHE_SIZE) /* found */ if (i < HFONT_CACHE_SIZE) /* found */
{ {
item = &editor->pFontCache[i]; item = &editor->pFontCache[i];
TRACE("font reused %d\n", i); TRACE_(richedit_style)("font reused %d\n", i);
s->hFont = item->hFont; s->hFont = item->hFont;
item->nRefs++; item->nRefs++;
...@@ -332,13 +333,13 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s) ...@@ -332,13 +333,13 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s)
assert(nEmpty != -1); /* otherwise we leak cache entries or get too many fonts at once*/ assert(nEmpty != -1); /* otherwise we leak cache entries or get too many fonts at once*/
if (item->hFont) { if (item->hFont) {
TRACE("font deleted %d\n", nEmpty); TRACE_(richedit_style)("font deleted %d\n", nEmpty);
DeleteObject(item->hFont); DeleteObject(item->hFont);
item->hFont = NULL; item->hFont = NULL;
} }
s->hFont = CreateFontIndirectW(&lf); s->hFont = CreateFontIndirectW(&lf);
assert(s->hFont); assert(s->hFont);
TRACE("font created %d\n", nEmpty); TRACE_(richedit_style)("font created %d\n", nEmpty);
item->hFont = s->hFont; item->hFont = s->hFont;
item->nRefs = 1; item->nRefs = 1;
memcpy(&item->lfSpecs, &lf, sizeof(LOGFONTW)); memcpy(&item->lfSpecs, &lf, sizeof(LOGFONTW));
...@@ -391,9 +392,9 @@ void ME_ReleaseStyle(ME_Style *s) ...@@ -391,9 +392,9 @@ void ME_ReleaseStyle(ME_Style *s)
s->nRefs--; s->nRefs--;
all_refs--; all_refs--;
if (s->nRefs==0) if (s->nRefs==0)
TRACE("destroy style %p, total refs=%d\n", s, all_refs); TRACE_(richedit_style)("destroy style %p, total refs=%d\n", s, all_refs);
else else
TRACE("release style %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs); TRACE_(richedit_style)("release style %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
if (!all_refs) TRACE("all style references freed (good!)\n"); if (!all_refs) TRACE("all style references freed (good!)\n");
assert(s->nRefs>=0); assert(s->nRefs>=0);
if (!s->nRefs) if (!s->nRefs)
......
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