Module: wine Branch: refs/heads/master Commit: 4e796854afd374833a232bc68a45ca1a89a2c119 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=4e796854afd374833a232bc6...
Author: Phil Krylov phil@newstar.rinet.ru Date: Wed Apr 12 02:00:01 2006 +0400
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(+), 0 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index bcb2a5c..3bc27a4 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -488,6 +488,9 @@ static void ME_RTFTblAttrHook(RTF_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 174514e..d08bb80 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -136,8 +136,26 @@ ME_DisplayItem *ME_SplitParagraph(ME_Tex 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) {