Commit 670dadf7 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Return paragraph ptrs from the remaining table insert functions.

parent caa1d4a4
......@@ -966,7 +966,7 @@ void ME_RTFSpecialCharHook(RTF_Info *info)
tableDef->row_start = table_insert_row_start_at_para( info->editor, para );
info->nestingLevel = 1;
}
ME_InsertTableCellFromCursor(info->editor);
table_insert_cell( info->editor, info->editor->pCursors );
}
}
else /* v1.0 - v3.0 */
......@@ -1018,7 +1018,7 @@ void ME_RTFSpecialCharHook(RTF_Info *info)
nRightBoundary += defaultCellSize;
cell->member.cell.nRightBoundary = nRightBoundary;
}
para = &ME_InsertTableCellFromCursor(info->editor)->member.para;
para = table_insert_cell( info->editor, info->editor->pCursors );
cell = para->pCell;
cell->member.cell.nRightBoundary = nRightBoundary;
}
......@@ -1033,7 +1033,7 @@ void ME_RTFSpecialCharHook(RTF_Info *info)
cell = cell->member.cell.next_cell;
if (!cell)
{
para = &ME_InsertTableCellFromCursor(info->editor)->member.para;
para = table_insert_cell( info->editor, info->editor->pCursors );
cell = para->pCell;
}
}
......@@ -1056,7 +1056,7 @@ void ME_RTFSpecialCharHook(RTF_Info *info)
nChars, TRUE);
}
para = &ME_InsertTableRowEndFromCursor(info->editor)->member.para;
para = table_insert_row_end( info->editor, info->editor->pCursors );
para->fmt.dxOffset = abs(info->tableDef->gapH);
para->fmt.dxStartIndent = info->tableDef->leftEdge;
ME_ApplyBorderProperties( info, &para->border, tableDef->border );
......
......@@ -279,9 +279,9 @@ ME_Paragraph *editor_first_para( ME_TextEditor *editor ) DECLSPEC_HIDDEN;
/* table.c */
BOOL ME_IsInTable(ME_DisplayItem *pItem) DECLSPEC_HIDDEN;
ME_DisplayItem *ME_InsertTableCellFromCursor(ME_TextEditor *editor) DECLSPEC_HIDDEN;
ME_DisplayItem *ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) DECLSPEC_HIDDEN;
ME_Paragraph *table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_cell( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
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;
ME_Paragraph *table_outer_para( ME_Paragraph *para ) DECLSPEC_HIDDEN;
......
......@@ -113,21 +113,19 @@ ME_Paragraph* table_insert_row_start_at_para( ME_TextEditor *editor, ME_Paragrap
/* Inserts a diCell and starts a new paragraph for the next cell.
*
* Returns the first paragraph of the new cell. */
ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor)
ME_Paragraph* table_insert_cell( ME_TextEditor *editor, ME_Cursor *cursor )
{
ME_Paragraph *para;
WCHAR tab = '\t';
para = table_insert_end_para( editor, editor->pCursors, &tab, 1, MEPF_CELL );
return para_get_di( para );
return table_insert_end_para( editor, editor->pCursors, &tab, 1, MEPF_CELL );
}
ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor)
ME_Paragraph* table_insert_row_end( ME_TextEditor *editor, ME_Cursor *cursor )
{
ME_Paragraph *para;
para = table_insert_end_para( editor, editor->pCursors, cr_lf, 2, MEPF_ROWEND );
return para_get_di( para_prev( para ) );
para = table_insert_end_para( editor, cursor, cr_lf, 2, MEPF_ROWEND );
return para_prev( para );
}
ME_Paragraph* table_row_end( ME_Paragraph *para )
......@@ -424,13 +422,13 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
while (cell->member.cell.next_cell)
{
cell = cell->member.cell.next_cell;
para = &ME_InsertTableCellFromCursor( editor )->member.para;
para = table_insert_cell( editor, editor->pCursors );
insertedCell = ME_FindItemBack( para_get_di( para ), diCell );
/* Copy cell properties */
insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary;
insertedCell->member.cell.border = cell->member.cell.border;
};
para = &ME_InsertTableRowEndFromCursor(editor)->member.para;
para = table_insert_row_end( editor, editor->pCursors );
para->fmt = prev_table_end->fmt;
/* return the table row start for the inserted paragraph */
return para_next( &ME_FindItemFwd( cell, diParagraph )->member.para );
......
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