[ros-diffs] [akhaldi] 56602: [RICHED20] * Sync to Wine 1.5.4.

akhaldi at svn.reactos.org akhaldi at svn.reactos.org
Thu May 17 16:52:17 UTC 2012


Author: akhaldi
Date: Thu May 17 16:52:17 2012
New Revision: 56602

URL: http://svn.reactos.org/svn/reactos?rev=56602&view=rev
Log:
[RICHED20]
* Sync to Wine 1.5.4.

Modified:
    trunk/reactos/dll/win32/riched20/CMakeLists.txt
    trunk/reactos/dll/win32/riched20/caret.c
    trunk/reactos/dll/win32/riched20/editor.c
    trunk/reactos/dll/win32/riched20/editor.h
    trunk/reactos/dll/win32/riched20/paint.c
    trunk/reactos/dll/win32/riched20/richole.c
    trunk/reactos/dll/win32/riched20/txtsrv.c
    trunk/reactos/dll/win32/riched20/wrap.c
    trunk/reactos/media/doc/README.WINE

Modified: trunk/reactos/dll/win32/riched20/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/CMakeLists.txt?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/CMakeLists.txt [iso-8859-1] Thu May 17 16:52:17 2012
@@ -3,8 +3,6 @@
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(riched20.dll riched20.spec ADD_IMPORTLIB)
-
-set_rc_compiler()
 
 list(APPEND SOURCE
     caret.c
@@ -51,5 +49,4 @@
     ntdll)
 
 add_pch(riched20 editor.h)
-
 add_cd_file(TARGET riched20 DESTINATION reactos/system32 FOR all)

Modified: trunk/reactos/dll/win32/riched20/caret.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/caret.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/caret.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -146,8 +146,11 @@
     {
       int start, end;
       ME_GetSelectionOfs(editor, &start, &end);
-      editor->pCursors[1] = editor->pCursors[0];
-      ME_Repaint(editor);
+      if (start != end)
+      {
+          editor->pCursors[1] = editor->pCursors[0];
+          ME_Repaint(editor);
+      }
       ME_ClearTempStyle(editor);
       return end;
     }

Modified: trunk/reactos/dll/win32/riched20/editor.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -2180,6 +2180,7 @@
         ME_DisplayItem *para = cursor.pPara;
         int from, to;
         const WCHAR endl = '\r';
+        const WCHAR endlv10[] = {'\r','\n'};
         ME_Style *style;
 
         if (editor->styleFlags & ES_READONLY) {
@@ -2282,7 +2283,10 @@
           if (shift_is_down)
             ME_InsertEndRowFromCursor(editor, 0);
           else
-            ME_InsertTextFromCursor(editor, 0, &endl, 1, style);
+            if (!editor->bEmulateVersion10)
+              ME_InsertTextFromCursor(editor, 0, &endl, 1, style);
+            else
+              ME_InsertTextFromCursor(editor, 0, endlv10, 2, style);
           ME_ReleaseStyle(style);
           ME_CommitCoalescingUndo(editor);
           SetCursor(NULL);
@@ -4459,7 +4463,7 @@
         ps.rcPaint.right = editor->rcFormat.right;
       }
 
-      ME_PaintContent(editor, hDC, FALSE, &ps.rcPaint);
+      ME_PaintContent(editor, hDC, &ps.rcPaint);
       EndPaint(editor->hWnd, &ps);
       return 0;
     }

Modified: trunk/reactos/dll/win32/riched20/editor.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.h?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] Thu May 17 16:52:17 2012
@@ -187,7 +187,7 @@
 
 /* wrap.c */
 BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN;
-void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) DECLSPEC_HIDDEN;
+void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor, ME_DisplayItem *start_para, ME_DisplayItem *end_para) DECLSPEC_HIDDEN;
 void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN;
 
 /* para.c */
@@ -207,7 +207,7 @@
 void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN;
 
 /* paint.c */
-void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) DECLSPEC_HIDDEN;
+void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) DECLSPEC_HIDDEN;
 void ME_Repaint(ME_TextEditor *editor) DECLSPEC_HIDDEN;
 void ME_RewrapRepaint(ME_TextEditor *editor) DECLSPEC_HIDDEN;
 void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN;

Modified: trunk/reactos/dll/win32/riched20/paint.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/paint.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/paint.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/paint.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -25,7 +25,7 @@
 
 static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph);
 
-void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate)
+void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
 {
   ME_DisplayItem *item;
   ME_Context c;
@@ -71,18 +71,9 @@
       ys -= item->member.para.pCell->member.cell.yTextOffset;
     }
 
-    if (!bOnlyNew || (item->member.para.nFlags & MEPF_REPAINT))
-    {
-      /* Draw the paragraph if any of the paragraph is in the update region. */
-      if (ys < rcUpdate->bottom && ye > rcUpdate->top)
-      {
-        ME_DrawParagraph(&c, item);
-        /* Clear the repaint flag if the whole paragraph is in the
-         * update region. */
-        if (rcUpdate->top <= ys && rcUpdate->bottom >= ye)
-          item->member.para.nFlags &= ~MEPF_REPAINT;
-      }
-    }
+    /* Draw the paragraph if any of the paragraph is in the update region. */
+    if (ys < rcUpdate->bottom && ye > rcUpdate->top)
+      ME_DrawParagraph(&c, item);
     item = item->member.para.next_para;
   }
   if (c.pt.y + editor->nTotalLength < c.rcView.bottom)
@@ -93,15 +84,6 @@
     rc.left = c.rcView.left;
     rc.bottom = c.rcView.bottom;
     rc.right = c.rcView.right;
-
-    if (bOnlyNew)
-    {
-      /* Only erase region drawn from previous call to ME_PaintContent */
-      if (editor->nTotalLength < editor->nLastTotalLength)
-        rc.bottom = c.pt.y + editor->nLastTotalLength;
-      else
-        SetRectEmpty(&rc);
-    }
 
     IntersectRect(&rc, &rc, rcUpdate);
 
@@ -316,7 +298,7 @@
       hPen = CreatePen(PS_DOT, 1, rgb);
       break;
     default:
-      WINE_FIXME("Unknown underline type (%u)\n", s->fmt.bUnderlineType);
+      FIXME("Unknown underline type (%u)\n", s->fmt.bUnderlineType);
       /* fall through */
     case CFU_CF1UNDERLINE: /* this type is supported in the font, do nothing */
     case CFU_UNDERLINENONE:
@@ -1275,7 +1257,8 @@
 void
 ME_InvalidateSelection(ME_TextEditor *editor)
 {
-  ME_DisplayItem *para1, *para2;
+  ME_DisplayItem *sel_start, *sel_end;
+  ME_DisplayItem *repaint_start = NULL, *repaint_end = NULL;
   int nStart, nEnd;
   int len = ME_GetTextLength(editor);
 
@@ -1285,32 +1268,39 @@
   if (nStart == nEnd && editor->nLastSelStart == editor->nLastSelEnd)
     return;
   ME_WrapMarkedParagraphs(editor);
-  ME_GetSelectionParas(editor, &para1, &para2);
-  assert(para1->type == diParagraph);
-  assert(para2->type == diParagraph);
+  ME_GetSelectionParas(editor, &sel_start, &sel_end);
+  assert(sel_start->type == diParagraph);
+  assert(sel_end->type == diParagraph);
   /* last selection markers aren't always updated, which means
    * they can point past the end of the document */
   if (editor->nLastSelStart > len || editor->nLastSelEnd > len) {
-    ME_MarkForPainting(editor,
-        ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph),
-        editor->pBuffer->pLast);
+    repaint_start = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph);
+    repaint_end = editor->pBuffer->pLast;
+    ME_MarkForPainting(editor, repaint_start, repaint_end);
   } else {
     /* if the start part of selection is being expanded or contracted... */
     if (nStart < editor->nLastSelStart) {
-      ME_MarkForPainting(editor, para1, editor->pLastSelStartPara->member.para.next_para);
+      repaint_start = sel_start;
+      repaint_end = editor->pLastSelStartPara->member.para.next_para;
     } else if (nStart > editor->nLastSelStart) {
-      ME_MarkForPainting(editor, editor->pLastSelStartPara, para1->member.para.next_para);
-    }
+      repaint_start = editor->pLastSelStartPara;
+      repaint_end = sel_start->member.para.next_para;
+    }
+    ME_MarkForPainting(editor, repaint_start, repaint_end);
 
     /* if the end part of selection is being contracted or expanded... */
     if (nEnd < editor->nLastSelEnd) {
-      ME_MarkForPainting(editor, para2, editor->pLastSelEndPara->member.para.next_para);
+      if (!repaint_start) repaint_start = sel_end;
+      repaint_end = editor->pLastSelEndPara->member.para.next_para;
+      ME_MarkForPainting(editor, sel_end, repaint_end);
     } else if (nEnd > editor->nLastSelEnd) {
-      ME_MarkForPainting(editor, editor->pLastSelEndPara, para2->member.para.next_para);
-    }
-  }
-
-  ME_InvalidateMarkedParagraphs(editor);
+      if (!repaint_start) repaint_start = editor->pLastSelEndPara;
+      repaint_end = sel_end->member.para.next_para;
+      ME_MarkForPainting(editor, editor->pLastSelEndPara, repaint_end);
+    }
+  }
+
+  ME_InvalidateMarkedParagraphs(editor, repaint_start, repaint_end);
   /* remember the last invalidated position */
   ME_GetSelectionOfs(editor, &editor->nLastSelStart, &editor->nLastSelEnd);
   ME_GetSelectionParas(editor, &editor->pLastSelStartPara, &editor->pLastSelEndPara);

Modified: trunk/reactos/dll/win32/riched20/richole.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/richole.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -1669,6 +1669,7 @@
                  hMemDC, 0, 0, dibsect.dsBm.bmWidth,
                  dibsect.dsBm.bmHeight, SRCCOPY);
     }
+    DeleteDC(hMemDC);
     if (!stgm.pUnkForRelease) DeleteObject(stgm.u.hBitmap);
     break;
   case TYMED_ENHMF:

Modified: trunk/reactos/dll/win32/riched20/txtsrv.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txtsrv.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -54,96 +54,57 @@
 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
 
 typedef struct ITextServicesImpl {
+   IUnknown IUnknown_inner;
    ITextServices ITextServices_iface;
+   IUnknown *outer_unk;
+   LONG ref;
    ITextHost *pMyHost;
-   LONG ref;
    CRITICAL_SECTION csTxtSrv;
    ME_TextEditor *editor;
    char spare[256];
 } ITextServicesImpl;
 
-static const ITextServicesVtbl textservices_Vtbl;
-
-/******************************************************************
- *        CreateTextServices (RICHED20.4)
- */
-HRESULT WINAPI CreateTextServices(IUnknown  * pUnkOuter,
-                                  ITextHost * pITextHost,
-                                  IUnknown  **ppUnk)
-{
-   ITextServicesImpl *ITextImpl;
-   HRESULT hres;
-   TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
-   if (pITextHost == NULL)
-      return E_POINTER;
-
-   ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl));
-   if (ITextImpl == NULL)
-      return E_OUTOFMEMORY;
-   InitializeCriticalSection(&ITextImpl->csTxtSrv);
-   ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv");
-   ITextImpl->ref = 1;
-   ITextHost_AddRef(pITextHost);
-   ITextImpl->pMyHost = pITextHost;
-   ITextImpl->ITextServices_iface.lpVtbl = &textservices_Vtbl;
-   ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
-   ITextImpl->editor->exStyleFlags = 0;
-   ITextImpl->editor->rcFormat.left = 0;
-   ITextImpl->editor->rcFormat.top = 0;
-   ITextImpl->editor->rcFormat.right = 0;
-   ITextImpl->editor->rcFormat.bottom = 0;
-
-   ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
-
-   if (pUnkOuter)
-   {
-      FIXME("Support aggregation\n");
-      return CLASS_E_NOAGGREGATION;
+static inline ITextServicesImpl *impl_from_IUnknown(IUnknown *iface)
+{
+   return CONTAINING_RECORD(iface, ITextServicesImpl, IUnknown_inner);
+}
+
+static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
+{
+   ITextServicesImpl *This = impl_from_IUnknown(iface);
+
+   TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
+
+   if (IsEqualIID(riid, &IID_IUnknown))
+      *ppv = &This->IUnknown_inner;
+   else if IsEqualIID(riid, &IID_ITextServices)
+      *ppv = &This->ITextServices_iface;
+   else {
+      *ppv = NULL;
+      FIXME("Unknown interface: %s\n", debugstr_guid(riid));
+      return E_NOINTERFACE;
    }
 
-   *ppUnk = (IUnknown *)&ITextImpl->ITextServices_iface;
-   return S_OK;
-}
-
-static inline ITextServicesImpl *impl_from_ITextServices(ITextServices *iface)
-{
-   return CONTAINING_RECORD(iface, ITextServicesImpl, ITextServices_iface);
-}
-
-static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv)
-{
-   ITextServicesImpl *This = impl_from_ITextServices(iface);
-
-   TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
-   *ppv = NULL;
-   if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextServices))
-      *ppv = This;
-
-   if (*ppv)
-   {
-      IUnknown_AddRef((IUnknown *)(*ppv));
-      TRACE ("-- Interface = %p\n", *ppv);
-      return S_OK;
-   }
-   FIXME("Unknown interface: %s\n", debugstr_guid(riid));
-   return E_NOINTERFACE;
-}
-
-static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
-{
-   ITextServicesImpl *This = impl_from_ITextServices(iface);
-   DWORD ref = InterlockedIncrement(&This->ref);
-
-   TRACE("(%p/%p)->() AddRef from %d\n", This, iface, ref - 1);
+   IUnknown_AddRef((IUnknown*)*ppv);
+   return S_OK;
+}
+
+static ULONG WINAPI ITextServicesImpl_AddRef(IUnknown *iface)
+{
+   ITextServicesImpl *This = impl_from_IUnknown(iface);
+   LONG ref = InterlockedIncrement(&This->ref);
+
+   TRACE("(%p) ref=%d\n", This, ref);
+
    return ref;
 }
 
-static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
-{
-   ITextServicesImpl *This = impl_from_ITextServices(iface);
-   DWORD ref = InterlockedDecrement(&This->ref);
-
-   TRACE("(%p/%p)->() Release from %d\n", This, iface, ref + 1);
+static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface)
+{
+   ITextServicesImpl *This = impl_from_IUnknown(iface);
+   LONG ref = InterlockedDecrement(&This->ref);
+
+   TRACE("(%p) ref=%d\n", This, ref);
 
    if (!ref)
    {
@@ -153,6 +114,36 @@
       CoTaskMemFree(This);
    }
    return ref;
+}
+
+static const IUnknownVtbl textservices_inner_vtbl =
+{
+   ITextServicesImpl_QueryInterface,
+   ITextServicesImpl_AddRef,
+   ITextServicesImpl_Release
+};
+
+static inline ITextServicesImpl *impl_from_ITextServices(ITextServices *iface)
+{
+   return CONTAINING_RECORD(iface, ITextServicesImpl, ITextServices_iface);
+}
+
+static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID riid, void **ppv)
+{
+   ITextServicesImpl *This = impl_from_ITextServices(iface);
+   return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
+}
+
+static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
+{
+   ITextServicesImpl *This = impl_from_ITextServices(iface);
+   return IUnknown_AddRef(This->outer_unk);
+}
+
+static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
+{
+   ITextServicesImpl *This = impl_from_ITextServices(iface);
+   return IUnknown_Release(This->outer_unk);
 }
 
 DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam,
@@ -370,7 +361,7 @@
 DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxPropertyBitsChange,12)
 DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCachedSize,12)
 
-static const ITextServicesVtbl textservices_Vtbl =
+static const ITextServicesVtbl textservices_vtbl =
 {
    fnTextSrv_QueryInterface,
    fnTextSrv_AddRef,
@@ -394,3 +385,42 @@
    THISCALL(fnTextSrv_OnTxPropertyBitsChange),
    THISCALL(fnTextSrv_TxGetCachedSize)
 };
+
+/******************************************************************
+ *        CreateTextServices (RICHED20.4)
+ */
+HRESULT WINAPI CreateTextServices(IUnknown  *pUnkOuter, ITextHost *pITextHost, IUnknown  **ppUnk)
+{
+   ITextServicesImpl *ITextImpl;
+   HRESULT hres;
+   TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
+   if (pITextHost == NULL)
+      return E_POINTER;
+
+   ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl));
+   if (ITextImpl == NULL)
+      return E_OUTOFMEMORY;
+   InitializeCriticalSection(&ITextImpl->csTxtSrv);
+   ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv");
+   ITextImpl->ref = 1;
+   ITextHost_AddRef(pITextHost);
+   ITextImpl->pMyHost = pITextHost;
+   ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
+   ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl;
+   ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
+   ITextImpl->editor->exStyleFlags = 0;
+   ITextImpl->editor->rcFormat.left = 0;
+   ITextImpl->editor->rcFormat.top = 0;
+   ITextImpl->editor->rcFormat.right = 0;
+   ITextImpl->editor->rcFormat.bottom = 0;
+
+   ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
+
+   if (pUnkOuter)
+      ITextImpl->outer_unk = pUnkOuter;
+   else
+      ITextImpl->outer_unk = &ITextImpl->IUnknown_inner;
+
+   *ppUnk = &ITextImpl->IUnknown_inner;
+   return S_OK;
+}

Modified: trunk/reactos/dll/win32/riched20/wrap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/wrap.c?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/dll/win32/riched20/wrap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/riched20/wrap.c [iso-8859-1] Thu May 17 16:52:17 2012
@@ -583,12 +583,22 @@
   tp->member.para.nRows = wc.nRow;
 }
 
+static void ME_MarkRepaintEnd(ME_DisplayItem *para,
+                              ME_DisplayItem **repaint_start,
+                              ME_DisplayItem **repaint_end)
+{
+    if (!*repaint_start)
+      *repaint_start = para;
+    *repaint_end = para->member.para.next_para;
+    para->member.para.nFlags |= MEPF_REPAINT;
+}
+
 BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
 {
   ME_DisplayItem *item;
   ME_Context c;
-  BOOL bModified = FALSE;
   int totalWidth = 0;
+  ME_DisplayItem *repaint_start = NULL, *repaint_end = NULL;
 
   ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost));
   c.pt.x = 0;
@@ -605,9 +615,7 @@
     ME_WrapTextParagraph(&c, item);
 
     if (bRedraw)
-      item->member.para.nFlags |= MEPF_REPAINT;
-
-    bModified = bModified | bRedraw;
+      ME_MarkRepaintEnd(item, &repaint_start, &repaint_end);
 
     if (item->member.para.nFlags & MEPF_ROWSTART)
     {
@@ -678,10 +686,10 @@
       {
         /* The height of the cells has grown, so invalidate the bottom of
          * the cells. */
-        item->member.para.nFlags |= MEPF_REPAINT;
+        ME_MarkRepaintEnd(item, &repaint_start, &repaint_end);
         cell = ME_FindItemBack(item, diCell);
         while (cell) {
-          ME_FindItemBack(cell, diParagraph)->member.para.nFlags |= MEPF_REPAINT;
+          ME_MarkRepaintEnd(ME_FindItemBack(cell, diParagraph), &repaint_start, &repaint_end);
           cell = cell->member.cell.prev_cell;
         }
       }
@@ -729,12 +737,17 @@
 
   ME_DestroyContext(&c);
 
-  if (bModified || editor->nTotalLength < editor->nLastTotalLength)
-    ME_InvalidateMarkedParagraphs(editor);
-  return bModified;
-}
-
-void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor)
+  if (repaint_start || editor->nTotalLength < editor->nLastTotalLength)
+  {
+    if (!repaint_start) repaint_start = editor->pBuffer->pFirst;
+    ME_InvalidateMarkedParagraphs(editor, repaint_start, repaint_end);
+  }
+  return !!repaint_start;
+}
+
+void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor,
+                                   ME_DisplayItem *start_para,
+                                   ME_DisplayItem *end_para)
 {
   ME_Context c;
   RECT rc;
@@ -745,14 +758,13 @@
   rc = c.rcView;
   ofs = editor->vert_si.nPos;
 
-  item = editor->pBuffer->pFirst;
-  while(item != editor->pBuffer->pLast) {
+  item = start_para;
+  while(item && item != end_para) {
     if (item->member.para.nFlags & MEPF_REPAINT) {
       rc.top = c.rcView.top + item->member.para.pt.y - ofs;
-      rc.bottom = max(c.rcView.top + item->member.para.pt.y
-                      + item->member.para.nHeight - ofs,
-                      c.rcView.bottom);
+      rc.bottom = max(rc.top + item->member.para.nHeight, c.rcView.bottom);
       ITextHost_TxInvalidateRect(editor->texthost, &rc, TRUE);
+      item->member.para.nFlags &= ~MEPF_REPAINT;
     }
     item = item->member.para.next_para;
   }

Modified: trunk/reactos/media/doc/README.WINE
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=56602&r1=56601&r2=56602&view=diff
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu May 17 16:52:17 2012
@@ -139,7 +139,7 @@
 reactos/dll/win32/query           # Synced to Wine-1.3.37
 reactos/dll/win32/rasapi32        # Synced to Wine-1.3.37
 reactos/dll/win32/resutils        # Synced to Wine-1.3.37
-reactos/dll/win32/riched20        # Synced to Wine-1.3.37
+reactos/dll/win32/riched20        # Synced to Wine-1.5.4
 reactos/dll/win32/riched32        # Synced to Wine-1.3.37
 reactos/dll/win32/rpcrt4          # Synced to Wine-1.3.26
 reactos/dll/win32/rsabase         # Autosync




More information about the Ros-diffs mailing list