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); }