Broadcast changes on undo / redo of cell range deletion.

Change-Id: I48141ca77277c2de5b3526358cfadb12e3f4fbdd
This commit is contained in:
Kohei Yoshida
2013-11-27 21:27:57 -05:00
parent 8fc79e2392
commit f579d49aaf
3 changed files with 26 additions and 0 deletions

View File

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

View File

@@ -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();

View File

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