riched20 episode 4

Mike McCormack mike at codeweavers.com
Fri Mar 4 21:21:42 CST 2005


Krzysztof Foltman wrote:
> A few fixes comparing to the last try:
> 
> - exports same symbols as WinXP RICHED20.DLL (too bad none of them is 
> actually implemented)
> - s/XXXKF/FIXME/g
> - no __WINESRC__ anymore
> - some debug code removed or fixed (most of which is Mike McCormack's work)
> - minor formatting changes (tabs to spaces and such)
> - files in Makefile.in are sorted alphabetically
> - removed int 3 (not used anyway)
> - added missing LGPL to header files
> 
> Hope no indentation police is out to get me ;)
> 
> Krzysztof

Cool.  Getting closer.  I think this is almost ready to apply.  You 
might want to consider adding the following changes too.  They are 
mostly changes to debugging:

* change the name of the debug channel to "richedit" rather than 
riched20, because people interested in one will probably be interested 
in the other, and eventually the riched32 code will be a small wrapper 
round the riched20 code.

* remove the remaining #ifdefs as the were mostly around debugging code, 
and instead used the Wine debugging API.  The code that was in those 
#ifdefs will now always be compiled, which makes maintainence easier.

Mike

-------------- next part --------------
diff -urp dlls/riched20.kf/caret.c dlls/riched20/caret.c
--- dlls/riched20.kf/caret.c	2005-03-05 01:07:31.000000000 +0900
+++ dlls/riched20/caret.c	2005-03-05 11:21:14.000000000 +0900
@@ -21,7 +21,7 @@
 
 #include "editor.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(riched20);
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 void ME_GetSelection(ME_TextEditor *editor, int *from, int *to)
 {
@@ -957,4 +957,3 @@ BOOL ME_ArrowKey(ME_TextEditor *editor, 
   }
   return FALSE;
 }
-
diff -urp dlls/riched20.kf/editor.c dlls/riched20/editor.c
--- dlls/riched20.kf/editor.c	2005-03-05 04:17:04.000000000 +0900
+++ dlls/riched20/editor.c	2005-03-05 11:21:37.000000000 +0900
@@ -202,13 +202,14 @@
  *
  */
 
-/* #define UNDODEBUG */
-
 #include "editor.h"
 #include <ole2.h>
 #include <richole.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(riched20);
+#include <winreg.h>
+#define NO_SHLWAPI_STREAM 
+#include <shlwapi.h>
+ 
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 int me_debug = 0;
 HANDLE me_heap = NULL;
@@ -281,10 +282,6 @@ void DoWrap(ME_TextEditor *editor) {
   ReleaseDC(hWnd, hDC);
 }
 
-#include <winreg.h>
-#define NO_SHLWAPI_STREAM 
-#include <shlwapi.h>
- 
 ME_TextBuffer *ME_MakeText() {
   
   ME_TextBuffer *buf = ALLOC_OBJ(ME_TextBuffer);
@@ -721,9 +718,7 @@ LRESULT CALLBACK RICHED20_RichEditANSIWn
     return 1;
   }
   case WM_COMMAND:
-#if 0
-    fprintf(stderr, "editor wnd command = %d\n", LOWORD(wParam));
-#endif
+    TRACE("editor wnd command = %d\n", LOWORD(wParam));
     return 0;
   case WM_KEYDOWN:
     if (ME_ArrowKey(editor, LOWORD(wParam), GetKeyState(VK_CONTROL)<0)) {
diff -urp dlls/riched20.kf/editstr.h dlls/riched20/editstr.h
--- dlls/riched20.kf/editstr.h	2005-03-04 17:26:03.000000000 +0900
+++ dlls/riched20/editstr.h	2005-03-05 11:04:39.000000000 +0900
@@ -39,9 +39,7 @@
 #include <stdio.h>
 #include <commctrl.h>
 
-#ifdef __WINESRC__ 
 #include "wine/debug.h"
-#endif
 
 typedef struct tagME_String
 {
diff -urp dlls/riched20.kf/paint.c dlls/riched20/paint.c
--- dlls/riched20.kf/paint.c	2005-03-05 01:07:50.000000000 +0900
+++ dlls/riched20/paint.c	2005-03-05 11:27:18.000000000 +0900
@@ -20,6 +20,8 @@
 
 #include "editor.h"
 
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
 void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew) {
   ME_DisplayItem *item;
   ME_Context c;
@@ -268,7 +270,7 @@ void ME_DrawParagraph(ME_Context *c, ME_
           rc.right = c->rcView.left+run->pt.x+run->nWidth;
           rc.top = c->pt.y+run->pt.y;
           rc.bottom = c->pt.y+run->pt.y+height;
-          printf("rc = (%ld, %ld, %ld, %ld)\n", rc.left, rc.top, rc.right, rc.bottom);
+          TRACE("rc = (%ld, %ld, %ld, %ld)\n", rc.left, rc.top, rc.right, rc.bottom);
           if (run->nFlags & MERF_SKIPPED)
             DrawFocusRect(c->hDC, &rc);
           else
@@ -299,7 +301,7 @@ void ME_DrawParagraph(ME_Context *c, ME_
 
 void ME_UpdateScrollBar(ME_TextEditor *editor, int ypos)
 {
-  float perc;
+  float perc = 0.0;
   SCROLLINFO si;
   HWND hWnd = editor->hWnd;
   int overflow = editor->nTotalLength - editor->sizeWindow.cy;
@@ -325,7 +327,7 @@ void ME_UpdateScrollBar(ME_TextEditor *e
   }
   if (ypos != si.nPos)
   {
-/*    printf("ScrollWindow(%d, %d, %d, %0.4f)\n", si.nPos, si.nMax, ypos, perc); */
+    TRACE("ScrollWindow(%d, %d, %d, %0.4f)\n", si.nPos, si.nMax, ypos, perc);
     ScrollWindow(hWnd, 0, si.nPos - ypos, NULL, NULL);
     UpdateWindow(hWnd);
   }
@@ -355,4 +357,3 @@ void ME_EnsureVisible(ME_TextEditor *edi
     ME_UpdateScrollBar(editor, y + yheight - editor->sizeWindow.cy);  
   }
 }
-
diff -urp dlls/riched20.kf/para.c dlls/riched20/para.c
--- dlls/riched20.kf/para.c	2005-03-05 04:18:37.000000000 +0900
+++ dlls/riched20/para.c	2005-03-05 11:27:37.000000000 +0900
@@ -20,6 +20,8 @@
 
 #include "editor.h"
 
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
 static WCHAR wszParagraphSign[] = {0xB6, 0};
 
 void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text)
@@ -204,9 +206,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_Tex
     pTmp = ME_FindItemFwd(pTmp, diRunOrParagraphOrEnd);
     if (pTmp->type != diRun)
       break;
-/*
-    printf("shifting \"%s\" by %d (previous %d)\n", pTmp->member.run.strText->szData, shift, pTmp->member.run.nCharOfs);
-    */
+    TRACE("shifting \"%s\" by %d (previous %d)\n", debugstr_w(pTmp->member.run.strText->szData), shift, pTmp->member.run.nCharOfs);
     pTmp->member.run.nCharOfs += shift;
   } while(1);
   
diff -urp dlls/riched20.kf/row.c dlls/riched20/row.c
--- dlls/riched20.kf/row.c	2005-02-28 00:35:09.000000000 +0900
+++ dlls/riched20/row.c	2005-03-05 11:07:16.000000000 +0900
@@ -82,5 +82,3 @@ ME_DisplayItem *ME_RowEnd(ME_DisplayItem
   if (!item2) return NULL;
   return ME_FindItemBack(item, diRun);
 }
-
-
diff -urp dlls/riched20.kf/run.c dlls/riched20/run.c
--- dlls/riched20.kf/run.c	2005-03-05 04:15:43.000000000 +0900
+++ dlls/riched20/run.c	2005-03-05 11:14:21.000000000 +0900
@@ -22,7 +22,7 @@
 
 #include "editor.h"
 
-#undef VERBOSE_CHECKCHAROFFSETS
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 int ME_CanJoinRuns(ME_Run *run1, ME_Run *run2)
 {
@@ -46,9 +46,7 @@ void ME_PropagateCharOffset(ME_DisplayIt
 {
   if (p->type == diRun) /* propagate in all runs in this para */
   {
-    /*
-    printf("PropagateCharOffset(%ls, %d)\n", p->member.run.strText->szData, shift);
-    */
+    TRACE("PropagateCharOffset(%s, %d)\n", debugstr_w(p->member.run.strText->szData), shift);
     do {
       p->member.run.nCharOfs += shift;
       assert(p->member.run.nCharOfs >= 0);
@@ -74,35 +72,30 @@ void ME_CheckCharOffsets(ME_TextEditor *
 {
   ME_DisplayItem *p = editor->pBuffer->pFirst;
   int ofs = 0, ofsp = 0;
-#ifdef VERBOSE_CHECKCHAROFFSETS
-  fprintf(stderr, "---\n");
-  ME_DumpDocument(editor->pBuffer);
-#endif
+  if(TRACE_ON(richedit))
+  {
+    TRACE("---\n");
+    ME_DumpDocument(editor->pBuffer);
+  }
   do {
     p = ME_FindItemFwd(p, diRunOrParagraphOrEnd);
     switch(p->type) {
       case diTextEnd:
-#ifdef VERBOSE_CHECKCHAROFFSETS
-        fprintf(stderr, "tend, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
-#endif
+        TRACE("tend, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
         assert(ofsp+ofs == p->member.para.nCharOfs);
         return;
       case diParagraph:
-#ifdef VERBOSE_CHECKCHAROFFSETS
-        fprintf(stderr, "para, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
-#endif
+        TRACE("para, real ofsp = %d, counted = %d\n", p->member.para.nCharOfs, ofsp+ofs);
         assert(ofsp+ofs == p->member.para.nCharOfs);
         ofsp = p->member.para.nCharOfs;
         ofs = 0;
         break;
       case diRun:
-#ifdef VERBOSE_CHECKCHAROFFSETS
-        fprintf(stderr, "run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = \"%ls\", flags=%08x, fx&mask = %08lx\n", 
+        TRACE("run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = \"%s\", flags=%08x, fx&mask = %08lx\n", 
           p->member.run.nCharOfs, p->member.run.nCharOfs+ofsp, ofsp+ofs, 
-          p->member.run.strText->nLen, p->member.run.strText->szData,
+          p->member.run.strText->nLen, debugstr_w(p->member.run.strText->szData),
           p->member.run.nFlags,
           p->member.run.style->fmt.dwMask & p->member.run.style->fmt.dwEffects);
-#endif
         assert(ofs == p->member.run.nCharOfs);
         ofs += ME_StrLen(p->member.run.strText);
         break;
@@ -154,7 +147,6 @@ void ME_RunOfsFromCharOfs(ME_TextEditor 
         ME_DisplayItem *pNext = ME_FindItemFwd(*ppRun, diRun);
         assert(pNext);
         assert(pNext->type == diRun);
-    /*    printf("run: \"%s\", nOfs = %d\n",  */
         if (nCharOfs < nParaOfs + pNext->member.run.nCharOfs) {
           *pOfs = ME_PosToVPos((*ppRun)->member.run.strText, 
             nCharOfs - nParaOfs - (*ppRun)->member.run.nCharOfs);
@@ -192,11 +184,12 @@ void ME_JoinRuns(ME_TextEditor *editor, 
   ME_Remove(pNext);
   ME_DestroyDisplayItem(pNext);
   ME_UpdateRunFlags(editor, &p->member.run);
-/*
-  printf("Before check after join\n");
-  ME_CheckCharOffsets(editor);
-  printf("After check after join\n");
-  */
+  if(TRACE_ON(richedit))
+  {
+    TRACE("Before check after join\n");
+    ME_CheckCharOffsets(editor);
+    TRACE("After check after join\n");
+  }
 }
 
 ME_DisplayItem *ME_SplitRun(ME_Context *c, ME_DisplayItem *item, int nVChar)
@@ -206,18 +199,17 @@ ME_DisplayItem *ME_SplitRun(ME_Context *
   ME_Run *run, *run2;
   
   assert(item->member.run.nCharOfs != -1);
-/*
-  printf("Before check before split\n");
-  ME_CheckCharOffsets(editor);
-  printf("After check before split\n");
-  */
+  if(TRACE_ON(richedit))
+  {
+    TRACE("Before check before split\n");
+    ME_CheckCharOffsets(editor);
+    TRACE("After check before split\n");
+  }
 
   run = &item->member.run;
-/*
-  printf("Before split: %s(%d, %d)\n", 
-    run->strText->szData, run->pt.x, run->pt.y
-    );
-    */
+
+  TRACE("Before split: %s(%ld, %ld)\n", debugstr_w(run->strText->szData),
+        run->pt.x, run->pt.y);
 
   item2 = ME_SplitRunSimple(editor, item, nVChar);
   
@@ -229,17 +221,15 @@ ME_DisplayItem *ME_SplitRun(ME_Context *
   run2->pt.x = run->pt.x+run->nWidth;
   run2->pt.y = run->pt.y;
   
-  /*
-  printf("Before check after split\n");
-  ME_CheckCharOffsets(editor);
-  printf("After check after split\n");
-  */
-  /*
-  printf("After split: %s(%d, %d), %s(%d, %d)\n", 
-    run->strText->szData, run->pt.x, run->pt.y,
-    run2->strText->szData, run2->pt.x, run2->pt.y
-    );
-    */
+  if(TRACE_ON(richedit))
+  {
+    TRACE("Before check after split\n");
+    ME_CheckCharOffsets(editor);
+    TRACE("After check after split\n");
+    TRACE("After split: %s(%ld, %ld), %s(%ld, %ld)\n", 
+      debugstr_w(run->strText->szData), run->pt.x, run->pt.y,
+      debugstr_w(run2->strText->szData), run2->pt.x, run2->pt.y);
+  }
 
   return item2;
 }
@@ -321,7 +311,7 @@ ME_DisplayItem *ME_InsertRun(ME_TextEdit
   pDI = ME_MakeRun(pItem->member.run.style, ME_StrDup(pItem->member.run.strText), pItem->member.run.nFlags);
   pDI->member.run.nCharOfs = tmp.pRun->member.run.nCharOfs;
   ME_InsertBefore(tmp.pRun, pDI);
-/* fprintf(stderr, "Shift length:%d\n", pDI->member.run.strText->nLen); */
+  TRACE("Shift length:%d\n", pDI->member.run.strText->nLen);
   ME_PropagateCharOffset(tmp.pRun, pDI->member.run.strText->nLen);
   ME_GetParagraph(tmp.pRun)->member.para.nFlags &= ~MEPF_WRAPPED;
   
@@ -584,7 +574,7 @@ void ME_SetDefaultCharFormat(ME_TextEdit
   editor->pBuffer->pDefaultStyle->tm = style->tm;
   ME_ReleaseStyle(style);
   ME_MarkAllForWrapping(editor);
-//  pcf = editor->pBuffer->pDefaultStyle->fmt;
+  /*  pcf = editor->pBuffer->pDefaultStyle->fmt; */
 }
 
 void ME_GetRunCharFormat(ME_TextEditor *editor, ME_DisplayItem *run, CHARFORMAT2W *pFmt)
@@ -679,4 +669,3 @@ void ME_GetCharFormat(ME_TextEditor *edi
     
   } while(run != run_end);
 }
-
diff -urp dlls/riched20.kf/string.c dlls/riched20/string.c
--- dlls/riched20.kf/string.c	2005-03-05 04:18:10.000000000 +0900
+++ dlls/riched20/string.c	2005-03-05 11:16:39.000000000 +0900
@@ -20,6 +20,8 @@
 
 #include "editor.h"     
 
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
 int ME_GetOptimalBuffer(int nLen)
 {
   return ((2*nLen+1)+128)&~63;
@@ -30,7 +32,7 @@ ME_String *ME_MakeString(LPCWSTR szText)
   ME_String *s = ALLOC_OBJ(ME_String);
   s->nLen = lstrlenW(szText);
   s->nBuffer = ME_GetOptimalBuffer(s->nLen+1);
-  s->szData = (WCHAR *)ALLOC_N_OBJ(WCHAR, s->nBuffer);
+  s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer);
   lstrcpyW(s->szData, szText);
   return s;
 }
@@ -43,7 +45,7 @@ ME_String *ME_MakeStringN(LPCWSTR szText
     ;
   s->nLen = i;
   s->nBuffer = ME_GetOptimalBuffer(s->nLen+1);
-  s->szData = (WCHAR *)ALLOC_N_OBJ(WCHAR, s->nBuffer);
+  s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer);
   lstrcpynW(s->szData, szText, s->nLen+1);
   return s;
 }
@@ -157,7 +159,8 @@ int ME_StrVLen(ME_String *s) {
 /* FIXME we use widechars, not multibytes, inside, no need for complex logic anymore */
 int ME_StrRelPos(ME_String *s, int nVChar, int *pRelChars)
 {
-  /* printf("StrRelPos(%ls,%d,&%d) = ", s->szData, nVChar, *pRelChars); */
+  TRACE("%s,%d,&%d\n", debugstr_w(s->szData), nVChar, *pRelChars);
+
   assert(*pRelChars);
   if (!*pRelChars) return nVChar;
   
diff -urp dlls/riched20.kf/style.c dlls/riched20/style.c
--- dlls/riched20.kf/style.c	2005-03-05 04:18:24.000000000 +0900
+++ dlls/riched20/style.c	2005-03-05 11:22:35.000000000 +0900
@@ -20,7 +20,7 @@
 
 #include "editor.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(riched20);
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 static int all_refs = 0;
 
@@ -196,7 +196,7 @@ void ME_DumpStyle(ME_Style *s)
 {
   char buf[2048];
   ME_DumpStyleToBuf(&s->fmt, buf);
-  MessageBoxA(NULL, buf, "Style dump", MB_OK);
+  TRACE("%s\n", buf);
 }
 
 void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
@@ -318,12 +318,10 @@ void ME_ReleaseStyle(ME_Style *s)
 {
   s->nRefs--;
   all_refs--;
-#ifdef REFDEBUG
   if (s->nRefs==0)
     TRACE("destroy style %p, total refs=%d\n", s, all_refs);
   else
     TRACE("release style %p, new refs=%d, total refs=%d\n", s, s->nRefs, all_refs);
-#endif
   if (!all_refs) FIXME("all style references freed (good!)\n");
   assert(s->nRefs>=0);
   if (!s->nRefs)
@@ -383,4 +381,3 @@ void ME_ClearTempStyle(ME_TextEditor *ed
   ME_ReleaseStyle(editor->pBuffer->pCharStyle);
   editor->pBuffer->pCharStyle = NULL;
 }
-
diff -urp dlls/riched20.kf/undo.c dlls/riched20/undo.c
--- dlls/riched20.kf/undo.c	2005-03-04 03:12:11.000000000 +0900
+++ dlls/riched20/undo.c	2005-03-05 11:21:02.000000000 +0900
@@ -20,15 +20,13 @@
 
 #include "editor.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(riched20);
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 void ME_EmptyUndoStack(ME_TextEditor *editor)
 {
   ME_DisplayItem *p, *pNext;
   
-#ifdef UNDODEBUG
-  fprintf(stderr, "Emptying undo stack\n");
-#endif
+  TRACE("Emptying undo stack\n");
 
   p = editor->pUndoStack;
   editor->pUndoStack = NULL;
@@ -88,12 +86,10 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEdito
     pItem->prev = NULL;
     if (editor->nUndoMode == umAddToUndo || editor->nUndoMode == umAddBackToUndo)
     {
-#ifdef UNDODEBUG
       if (editor->nUndoMode == umAddToUndo)
-        fprintf(stderr, "Pushing id=%s to undo stack, deleting redo stack\n", ME_GetDITypeName(type));
+        TRACE("Pushing id=%s to undo stack, deleting redo stack\n", ME_GetDITypeName(type));
       else
-        fprintf(stderr, "Pushing id=%s to undo stack\n", ME_GetDITypeName(type));
-#endif
+        TRACE("Pushing id=%s to undo stack\n", ME_GetDITypeName(type));
       pItem->next = editor->pUndoStack;
       if (editor->pUndoStack)
         editor->pUndoStack->prev = pItem;
@@ -112,9 +108,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEdito
     }
     else if (editor->nUndoMode == umAddToRedo)
     {
-#ifdef UNDODEBUG
-      fprintf(stderr, "Pushing id=%s to redo stack\n", ME_GetDITypeName(type));
-#endif
+      TRACE("Pushing id=%s to redo stack\n", ME_GetDITypeName(type));
       pItem->next = editor->pRedoStack;
       if (editor->pRedoStack)
         editor->pRedoStack->prev = pItem;
@@ -145,9 +139,9 @@ void ME_CommitUndo(ME_TextEditor *editor
 void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)
 {
   ME_UndoItem *pUItem = (ME_UndoItem *)pItem;
-#ifdef UNDODEBUG
-  fprintf(stderr, "Playing undo/redo item, id=%s\n", ME_GetDITypeName(pItem->type));
-#endif
+
+  TRACE("Playing undo/redo item, id=%s\n", ME_GetDITypeName(pItem->type));
+
   switch(pItem->type)
   {
   case diUndoEndTransaction:
@@ -265,4 +259,3 @@ void ME_Redo(ME_TextEditor *editor) {
   editor->nModifyStep++;
   ME_UpdateRepaint(editor);
 }
-
diff -urp dlls/riched20.kf/wrap.c dlls/riched20/wrap.c
--- dlls/riched20.kf/wrap.c	2005-03-03 20:18:43.000000000 +0900
+++ dlls/riched20/wrap.c	2005-03-05 11:28:01.000000000 +0900
@@ -22,6 +22,8 @@
 
 #include "editor.h"
 
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
 /*
  * Unsolved problems:
  *  
@@ -102,7 +104,7 @@ void ME_WrapEndParagraph(ME_WrapContext 
     if (p->type == diRun)
     {
       ME_Run *run = &p->member.run;
-      printf("%s - (%d, %d)\n", run->strText->szData, run->pt.x, run->pt.y);
+      TRACE("%s - (%d, %d)\n", debugstr_w(run->strText->szData), run->pt.x, run->pt.y);
     }
     p = p->next;
   }
@@ -152,9 +154,7 @@ ME_DisplayItem *ME_MaximizeSplit(ME_Wrap
       /* this run is the end of spaces, so the run edge is a good point to split */
       wc->pt = pp->member.run.pt;
       wc->bOverflown = TRUE;
-      /*
-      printf("Split point is: %s|%s\n", piter->member.run.strText->szData, pp->member.run.strText->szData);
-      */
+      TRACE("Split point is: %s|%s\n", debugstr_w(piter->member.run.strText->szData), debugstr_w(pp->member.run.strText->szData));
       return pp;
     }
     wc->pt = piter->member.run.pt;
@@ -179,7 +179,7 @@ ME_DisplayItem *ME_SplitByBacktracking(M
     if (pp)
       return pp;
   }
-/*  printf("Must backtrack to split at: %s\n", p->member.run.strText->szData); */
+  TRACE("Must backtrack to split at: %s\n", debugstr_w(p->member.run.strText->szData));
   if (wc->pLastSplittableRun)
   {
     if (wc->pLastSplittableRun->member.run.nFlags & MERF_GRAPHICS)
@@ -216,7 +216,7 @@ ME_DisplayItem *ME_SplitByBacktracking(M
       return wc->pLastSplittableRun;
     }
   }
-  /* printf("Backtracking failed, trying desperate: %s\n", p->member.run.strText->szData);*/
+  TRACE("Backtracking failed, trying desperate: %s\n", debugstr_w(p->member.run.strText->szData));
   /* OK, no better idea, so assume we MAY split words if we can split at all*/
   if (idesp)
     return ME_SplitRun(wc->context, piter, idesp);
@@ -327,7 +327,7 @@ ME_DisplayItem *ME_WrapHandleRun(ME_Wrap
     /* we detected that it's best to split on start of this run */
     if (wc->bOverflown)
       return pp;
-    printf("failure!\n");
+    ERR("failure!\n");
     /* not found anything - writing over margins is the only option left */
   }
   if ((run->nFlags & (MERF_SPLITTABLE | MERF_STARTWHITE)) 
@@ -413,5 +413,3 @@ void ME_PrepareParagraphForWrapping(ME_C
     }
   }
 }
-
-


More information about the wine-patches mailing list