From 4e796854afd374833a232bc68a45ca1a89a2c119 Mon Sep 17 00:00:00 2001 From: Phil Krylov Date: Wed, 12 Apr 2006 02:00:01 +0400 Subject: [PATCH] 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. --- dlls/riched20/editor.c | 3 +++ dlls/riched20/para.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index bcb2a5ca455..3bc27a40de1 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -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; diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 174514e6aa2..d08bb80d696 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -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) {