Huw Davies : riched20: Use a paragraph ptr in the stream in function.

Alexandre Julliard julliard at winehq.org
Fri Oct 30 16:18:43 CDT 2020


Module: wine
Branch: master
Commit: 2bc67cfcf9293a4bf58a7bd0de5203c1a9ffbfdc
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2bc67cfcf9293a4bf58a7bd0de5203c1a9ffbfdc

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Oct 30 09:00:25 2020 +0000

riched20: Use a paragraph ptr in the stream in function.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/editor.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index d1667dc9176..057d5a31ce6 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1607,29 +1607,27 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
     ME_InternalDeleteText(editor, selStart, to - from, FALSE);
 
     /* Don't insert text at the end of the table row */
-    if (!editor->bEmulateVersion10) { /* v4.1 */
-      ME_DisplayItem *para = editor->pCursors->pPara;
-      if (para->member.para.nFlags & MEPF_ROWEND)
-      {
-        para = para->member.para.next_para;
-        editor->pCursors[0].pPara = para;
-        editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
-        editor->pCursors[0].nOffset = 0;
-      }
-      if (para->member.para.nFlags & MEPF_ROWSTART)
+    if (!editor->bEmulateVersion10) /* v4.1 */
+    {
+      ME_Paragraph *para = &editor->pCursors->pPara->member.para;
+      if (para->nFlags & (MEPF_ROWSTART | MEPF_ROWEND))
       {
-        para = para->member.para.next_para;
-        editor->pCursors[0].pPara = para;
-        editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
+        para = para_next( para );
+        editor->pCursors[0].pPara = para_get_di( para );
+        editor->pCursors[0].pRun = run_get_di( para_first_run( para ) );
         editor->pCursors[0].nOffset = 0;
       }
       editor->pCursors[1] = editor->pCursors[0];
-    } else { /* v1.0 - 3.0 */
+    }
+    else /* v1.0 - 3.0 */
+    {
       if (editor->pCursors[0].pRun->member.run.nFlags & MERF_ENDPARA &&
-          ME_IsInTable(editor->pCursors[0].pRun))
+          para_in_table( &editor->pCursors[0].pPara->member.para ))
         return 0;
     }
-  } else {
+  }
+  else
+  {
     style = editor->pBuffer->pDefaultStyle;
     ME_AddRefStyle(style);
     set_selection_cursors(editor, 0, 0);




More information about the wine-cvs mailing list