[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Nov 27 18:27:38 PST 2013


 sc/source/ui/inc/undobase.hxx  |    2 ++
 sc/source/ui/undo/undobase.cxx |   22 ++++++++++++++++++++++
 sc/source/ui/undo/undoblk3.cxx |    2 ++
 3 files changed, 26 insertions(+)

New commits:
commit 1280804baccbd0ea1eb61c989ecbfffbda81765c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Nov 27 21:27:57 2013 -0500

    Broadcast changes on undo / redo of cell range deletion.
    
    Change-Id: I48141ca77277c2de5b3526358cfadb12e3f4fbdd

diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index e57e308..5c9df4b 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -57,6 +57,8 @@ protected:
     void            BeginRedo();
     void            EndRedo();
 
+    void BroadcastChanges( const ScRange& rRange );
+
     static void     ShowTable( SCTAB nTab );
     static void     ShowTable( const ScRange& rRange );
 };
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 955d2ba..c38ff47 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -142,6 +142,28 @@ void ScSimpleUndo::EndRedo()
     pDocShell->SetInUndo( false );
 }
 
+void ScSimpleUndo::BroadcastChanges( const ScRange& rRange )
+{
+    ScDocument* pDoc = pDocShell->GetDocument();
+    pDoc->CellContentModified();
+
+    ScHint aHint(SC_HINT_DATACHANGED, ScAddress());
+    ScAddress& rPos = aHint.GetAddress();
+    for (SCTAB nTab = rRange.aStart.Tab(); nTab <= rRange.aEnd.Tab(); ++nTab)
+    {
+        rPos.SetTab(nTab);
+        for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
+        {
+            rPos.SetCol(nCol);
+            for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
+            {
+                rPos.SetRow(nRow);
+                pDoc->Broadcast(aHint);
+            }
+        }
+    }
+}
+
 void ScSimpleUndo::ShowTable( SCTAB nTab )
 {
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index c3953c6..fe94d09 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -182,6 +182,7 @@ void ScUndoDeleteContents::Undo()
     DoChange( sal_True );
     EndUndo();
 
+    BroadcastChanges(aRange);
     HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, aRange);
 }
 
@@ -191,6 +192,7 @@ void ScUndoDeleteContents::Redo()
     DoChange( false );
     EndRedo();
 
+    BroadcastChanges(aRange);
     HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, aRange);
 }
 


More information about the Libreoffice-commits mailing list