Dylan Smith : richedit: Make sure border properties are saved for undo/redo .

Alexandre Julliard julliard at winehq.org
Wed Oct 1 14:09:33 CDT 2008


Module: wine
Branch: master
Commit: 3df78710a962c7f50e3f395c4e6e06f90ff88d98
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3df78710a962c7f50e3f395c4e6e06f90ff88d98

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Tue Sep 30 17:11:19 2008 -0400

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(+), 0 deletions(-)

diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c
index 517bf28..565e323 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 8f3a22b..49802a3 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;
   }




More information about the wine-cvs mailing list