From 2bc67cfcf9293a4bf58a7bd0de5203c1a9ffbfdc Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 30 Oct 2020 09:00:25 +0000 Subject: [PATCH] riched20: Use a paragraph ptr in the stream in function. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- 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) + 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); - editor->pCursors[0].nOffset = 0; - } - if (para->member.para.nFlags & MEPF_ROWSTART) - { - 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);