diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-14 11:50:53 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-15 17:37:51 +0000 |
commit | b0dd584efde8b9d75fb822a4ff63e96ca36b42c1 (patch) | |
tree | a7492184bf0586883490f92b8b7cf5294a376f4c | |
parent | adce7994e9cecf761381c87bc8ff77320077f894 (diff) |
fdo#73606: Avoid calling MarkDataChanged() when nothing is selected.
MarkDataChanged() is quite expensive & in theory unnecessary when no
selection is present.
Change-Id: I6967b914735462403a77568010532b37a1d8f333
(cherry picked from commit 31533d47b24680f76e769949874d41f0fe27134f)
Reviewed-on: https://gerrit.libreoffice.org/7426
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 9553184ed7c0..5c6784f256a0 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1024,9 +1024,15 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, if (!bShift) { // Remove all marked data on cursor movement unless the Shift is locked. - ScMarkData aData(aViewData.GetMarkData()); - aData.ResetMark(); - SetMarkData(aData); + ScMarkData& rMark = aViewData.GetMarkData(); + bool bMarked = rMark.IsMarked() || rMark.IsMultiMarked(); + if (bMarked) + { + rMark.ResetMark(); + DoneBlockMode(); + InitOwnBlockMode(); + MarkDataChanged(); + } } bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() ); |