From 3df78710a962c7f50e3f395c4e6e06f90ff88d98 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Tue, 30 Sep 2008 17:11:19 -0400 Subject: [PATCH] richedit: Make sure border properties are saved for undo/redo. Previously the paragraph and cell border properties were lost when deleting the text, then undoing the deletion. This would cause tables to lose the colour and width of the table border. --- dlls/riched20/para.c | 1 + dlls/riched20/undo.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 517bf28c417..565e323422d 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -287,6 +287,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp, { ME_AddUndoItem(editor, diUndoSetParagraphFormat, tp); *tp->member.para.pFmt = *pNext->member.para.pFmt; + tp->member.para.border = pNext->member.para.border; } if (!editor->bEmulateVersion10) { /* v4.1 */ diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index 8f3a22bdace..49802a357d4 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -96,6 +96,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp pItem->member.para.pFmt->cbSize = sizeof(PARAFORMAT2); pItem->member.para.pFmt->dwMask = 0; *pItem->member.para.pFmt = *pdi->member.para.pFmt; + pItem->member.para.border = pdi->member.para.border; pItem->member.para.nFlags = prev_para->member.para.nFlags & ~MEPF_CELL; pItem->member.para.pCell = NULL; break; @@ -293,6 +294,7 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) para = ME_FindItemBack(tmp.pRun, diParagraph); ME_AddUndoItem(editor, diUndoSetParagraphFormat, para); *para->member.para.pFmt = *pItem->member.para.pFmt; + para->member.para.border = pItem->member.para.border; break; } case diUndoSetCharFormat: @@ -343,12 +345,14 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) new_para->member.para.nFlags |= MEPF_ROWSTART; assert(pItem->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *new_para->member.para.pFmt = *pItem->member.para.pFmt; + new_para->member.para.border = pItem->member.para.border; if (pItem->member.para.pCell) { ME_DisplayItem *pItemCell, *pCell; pItemCell = pItem->member.para.pCell; pCell = new_para->member.para.pCell; pCell->member.cell.nRightBoundary = pItemCell->member.cell.nRightBoundary; + pCell->member.cell.border = pItemCell->member.cell.border; } break; }