riched20: Allow inheriting table cell definitions from previous
table row
Phil Krylov
phil at newstar.rinet.ru
Tue Apr 11 17:00:01 CDT 2006
Hi,
It seems that I've run out of disk space and the previous mail was sent
corrupted.
This patch fixed bug #4900.
ChangeLog:
riched20: 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(-)
772df6b03f0533459798fb53d272482d44b38c8b
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 6b6f6ef..dda0347 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)
{
--
1.2.4
More information about the wine-patches
mailing list