diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-27 21:06:30 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-27 21:21:16 -0500 |
commit | 3032d08226f77505e7105fb7cfb7f4b4741fd3ca (patch) | |
tree | 154555d4879caaa635fa7ad377f0150962775104 /sc | |
parent | fa11b0842a51b59eb131a084310c177235ebe487 (diff) |
fdo#74014: Broadcast cells on undoing of "cut".
Change-Id: I0fdf518078c86f259e72307f8011a988555a9235
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 6a980ab298f2..3b106d75a1b7 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1808,6 +1808,11 @@ public: */ void Broadcast( const ScHint& rHint ); + /** + * Cell broadcast in specified range. + */ + void BroadcastCells( const ScRange& rRange, sal_uLong nHint ); + /// only area, no cell broadcast void AreaBroadcast( const ScHint& rHint ); /// only areas in range, no cell broadcasts diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index ee3e35d543a6..805fb3cc826e 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -170,4 +170,24 @@ bool ScDocument::CopyOneCellFromClip( return true; } +void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint ) +{ + ScHint aHint(nHint, 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); + Broadcast(aHint); + } + } + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 946ed998d751..9d8330901356 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -786,6 +786,8 @@ void ScUndoCut::DoChange( const sal_Bool bUndo ) ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); + + pDoc->BroadcastCells(aCopyRange, SC_HINT_DATACHANGED); } else // only for Redo { |