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) {