[PATCH 1/5] riched20: Use a paragraph ptr in the stream in function.

Huw Davies huw at codeweavers.com
Fri Oct 30 04:00:25 CDT 2020


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 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);
-- 
2.23.0




More information about the wine-devel mailing list