diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-10 00:22:51 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-12 13:22:07 -0400 |
commit | f7d29b4494824a8560f062a704502e6d960bed4f (patch) | |
tree | 9e4aad90442cfd342743d83d8278c4a026800076 /sc/source | |
parent | 64340f4c2b7aa25a9f9e98ad2668df13660c08d1 (diff) |
Properly mark multiple ranges during undo and redo.
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/undo/undobase.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 5db312492dd5..89d716007ae7 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -372,15 +372,23 @@ void ScMultiBlockUndo::ShowBlock() if (maBlockRanges.empty()) return; - // Show the very first range. - ScRange aRange = *maBlockRanges[0]; + // Move to the sheet of the first range. + ScRange aRange = *maBlockRanges.front(); ShowTable(aRange); pViewShell->MoveCursorAbs( aRange.aStart.Col(), aRange.aStart.Row(), SC_FOLLOW_JUMP, false, false); SCTAB nTab = pViewShell->GetViewData()->GetTabNo(); aRange.aStart.SetTab(nTab); aRange.aEnd.SetTab(nTab); - pViewShell->MarkRange(aRange); + pViewShell->MarkRange(aRange, false, false); + + for (size_t i = 1, n = maBlockRanges.size(); i < n; ++i) + { + aRange = *maBlockRanges[i]; + aRange.aStart.SetTab(nTab); + aRange.aEnd.SetTab(nTab); + pViewShell->MarkRange(aRange, false, true); + } } // ----------------------------------------------------------------------- |