summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-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;
};