Commit 3ba41908 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Use paragraph ptrs in the table move from row start function.

parent 96307570
......@@ -2690,7 +2690,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
}
else
return TRUE;
ME_MoveCursorFromTableRowStartParagraph(editor);
table_move_from_row_start( editor );
ME_UpdateSelectionLinkAttribute(editor);
ME_UpdateRepaint(editor, FALSE);
ME_SendRequestResize(editor, FALSE);
......
......@@ -302,6 +302,7 @@ ME_Paragraph *table_insert_cell( ME_TextEditor *editor, ME_Cursor *cursor ) DECL
ME_Paragraph *table_insert_row_end( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start_at_para( ME_TextEditor *editor, ME_Paragraph *para ) DECLSPEC_HIDDEN;
void table_move_from_row_start( ME_TextEditor *editor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_outer_para( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void table_protect_partial_deletion( ME_TextEditor *editor, ME_Cursor *c, int *num_chars ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_end( ME_Paragraph *para ) DECLSPEC_HIDDEN;
......@@ -309,7 +310,6 @@ ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
......
......@@ -629,16 +629,17 @@ void table_handle_tab( ME_TextEditor *editor, BOOL selected_row )
/* Make sure the cursor is not in the hidden table row start paragraph
* without a selection. */
void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor)
void table_move_from_row_start( ME_TextEditor *editor )
{
ME_DisplayItem *para = editor->pCursors[0].pPara;
if (para == editor->pCursors[1].pPara &&
para->member.para.nFlags & MEPF_ROWSTART) {
ME_Paragraph *para = &editor->pCursors[0].pPara->member.para;
if (para == &editor->pCursors[1].pPara->member.para && para->nFlags & MEPF_ROWSTART)
{
/* The cursors should not be at the hidden start row paragraph without
* a selection, so the cursor is moved into the first cell. */
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];
}
......
......@@ -438,7 +438,7 @@ BOOL ME_Undo(ME_TextEditor *editor)
destroy_undo_item( undo );
}
ME_MoveCursorFromTableRowStartParagraph(editor);
table_move_from_row_start( editor );
add_undo( editor, undo_end_transaction );
ME_CheckTablesForCorruption(editor);
editor->nUndoStackSize--;
......@@ -475,7 +475,7 @@ BOOL ME_Redo(ME_TextEditor *editor)
list_remove( &undo->entry );
destroy_undo_item( undo );
}
ME_MoveCursorFromTableRowStartParagraph(editor);
table_move_from_row_start( editor );
add_undo( editor, undo_end_transaction );
ME_CheckTablesForCorruption(editor);
editor->nUndoMode = nMode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment