riched20: Don't return the diTextStart paragraph from para_prev().

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-14 11:17:16 +01:00 committed by Alexandre Julliard
parent 02f4a178ff
commit bfac43798b
2 changed files with 3 additions and 5 deletions

View File

@ -774,12 +774,10 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
{ {
para = run->para; para = run->para;
/* Skip empty start of table row paragraph */ /* Skip empty start of table row paragraph */
if (para_prev( para )->nFlags & MEPF_ROWSTART) if (para_prev( para ) && para_prev( para )->nFlags & MEPF_ROWSTART)
para = para_prev( para ); para = para_prev( para );
/* Paragraph breaks are treated as separate words */ /* Paragraph breaks are treated as separate words */
if (para_get_di( para_prev( para ) )->type == diTextStart) if (!para_prev( para )) return FALSE;
return FALSE;
para = para_prev( para ); para = para_prev( para );
run = para_end_run( para ); run = para_end_run( para );
} }

View File

@ -64,7 +64,7 @@ ME_Paragraph *para_next( ME_Paragraph *para )
ME_Paragraph *para_prev( ME_Paragraph *para ) ME_Paragraph *para_prev( ME_Paragraph *para )
{ {
if (para->prev_para) return &para->prev_para->member.para; if (para->prev_para && para->prev_para->type == diParagraph) return &para->prev_para->member.para;
return NULL; return NULL;
} }