summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-21 12:38:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-21 16:41:14 +0100
commita05fe3a8cfd4ec420eb6969d98f64e4308f14230 (patch)
treed2065e03992b73d19cfc29db4b34dfd521249acc
parentd9d8ee98338a956d7241f556de7c697919151f39 (diff)
Resolves: tdf#100950 only update page selection if pages changed
Change-Id: Ibe1c37c0b44bc1925df4810039fca874fb6c8e93 Reviewed-on: https://gerrit.libreoffice.org/45031 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx12
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx1
2 files changed, 10 insertions, 3 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
index 76f7638b2275..f21817486544 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
@@ -56,9 +56,10 @@ void SelectionObserver::Context::Abort()
//===== SelectionObserver =====================================================
SelectionObserver::SelectionObserver (SlideSorter& rSlideSorter)
- : mrSlideSorter(rSlideSorter),
- mbIsOvservationActive(false),
- maInsertedPages()
+ : mrSlideSorter(rSlideSorter)
+ , mbIsOvservationActive(false)
+ , mbPageEventOccurred(false)
+ , maInsertedPages()
{
}
@@ -71,6 +72,8 @@ void SelectionObserver::NotifyPageEvent (const SdrPage* pSdrPage)
if ( ! mbIsOvservationActive)
return;
+ mbPageEventOccurred = true;
+
const SdPage* pPage = dynamic_cast<const SdPage*>(pSdrPage);
if (pPage == nullptr)
return;
@@ -106,6 +109,9 @@ void SelectionObserver::EndObservation()
OSL_ASSERT(mbIsOvservationActive);
mbIsOvservationActive = false;
+ if (!mbPageEventOccurred)
+ return;
+
PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
PageSelector::UpdateLock aUpdateLock (mrSlideSorter);
rSelector.DeselectAllPages();
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx
index f0dad8bb2b07..1daf3593db6c 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionObserver.hxx
@@ -66,6 +66,7 @@ public:
private:
SlideSorter& mrSlideSorter;
bool mbIsOvservationActive;
+ bool mbPageEventOccurred;
::std::vector<const SdPage*> maInsertedPages;
};