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

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2020-10-30 09:00:25 +00:00 committed by Alexandre Julliard
parent 2873527819
commit 2bc67cfcf9
1 changed files with 14 additions and 16 deletions

View File

@ -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);