diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-27 21:27:57 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-27 21:28:45 -0500 |
commit | f579d49aafe53f6a5500c7c4a0ca28953de9fecf (patch) | |
tree | 89f384571062a35274262714af8f46aeb6f03b72 /sc/source | |
parent | 8fc79e23927156e883df36dfa3c607f4fcbdfe57 (diff) |
Broadcast changes on undo / redo of cell range deletion.
Change-Id: I48141ca77277c2de5b3526358cfadb12e3f4fbdd
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/undobase.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undobase.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx index e57e3081da34..5c9df4bf9f62 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 955d2ba4be51..c38ff47892b9 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 c3953c69afb8..fe94d096e727 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); } |