riched20: Allow inheriting table cell definitions from previous table row.

Allow inheriting of table cell definitions from a previous table row
when the current table row does not contain a \trowd, only an \intbl.
This commit is contained in:
Phil Krylov 2006-04-12 02:00:01 +04:00 committed by Alexandre Julliard
parent ac0bee4bf2
commit 4e796854af
2 changed files with 21 additions and 0 deletions

View file

@ -488,6 +488,9 @@ static void ME_RTFTblAttrHook(RTF_Info *info)
RTFFlushOutputBuffer(info);
para = ME_GetParagraph(info->editor->pCursors[0].pRun);
/* Release possibly inherited cell definitions */
ME_DestroyTableCellList(para);
para->member.para.pCells = ALLOC_OBJ(ME_TableCell);
para->member.para.pCells->nRightBoundary = 0;
para->member.para.pCells->next = NULL;

View file

@ -136,8 +136,26 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME
new_para->member.para.nFirstMargin = run_para->member.para.nFirstMargin;
new_para->member.para.bTable = run_para->member.para.bTable;
/* Inherit previous cell definitions if any */
new_para->member.para.pCells = NULL;
if (run_para->member.para.pCells)
{
ME_TableCell *pCell, *pNewCell;
for (pCell = run_para->member.para.pCells; pCell; pCell = pCell->next)
{
pNewCell = ALLOC_OBJ(ME_TableCell);
pNewCell->nRightBoundary = pCell->nRightBoundary;
pNewCell->next = NULL;
if (new_para->member.para.pCells)
new_para->member.para.pLastCell->next = pNewCell;
else
new_para->member.para.pCells = pNewCell;
new_para->member.para.pLastCell = pNewCell;
}
}
/* fix paragraph properties. FIXME only needed when called from RTF reader */
if (run_para->member.para.pCells && !run_para->member.para.bTable)
{