Kaydet (Commit) a05fe3a8 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#100950 only update page selection if pages changed

Change-Id: Ibe1c37c0b44bc1925df4810039fca874fb6c8e93
Reviewed-on: https://gerrit.libreoffice.org/45031Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d9d8ee98
...@@ -56,9 +56,10 @@ void SelectionObserver::Context::Abort() ...@@ -56,9 +56,10 @@ void SelectionObserver::Context::Abort()
//===== SelectionObserver ===================================================== //===== SelectionObserver =====================================================
SelectionObserver::SelectionObserver (SlideSorter& rSlideSorter) SelectionObserver::SelectionObserver (SlideSorter& rSlideSorter)
: mrSlideSorter(rSlideSorter), : mrSlideSorter(rSlideSorter)
mbIsOvservationActive(false), , mbIsOvservationActive(false)
maInsertedPages() , mbPageEventOccurred(false)
, maInsertedPages()
{ {
} }
...@@ -71,6 +72,8 @@ void SelectionObserver::NotifyPageEvent (const SdrPage* pSdrPage) ...@@ -71,6 +72,8 @@ void SelectionObserver::NotifyPageEvent (const SdrPage* pSdrPage)
if ( ! mbIsOvservationActive) if ( ! mbIsOvservationActive)
return; return;
mbPageEventOccurred = true;
const SdPage* pPage = dynamic_cast<const SdPage*>(pSdrPage); const SdPage* pPage = dynamic_cast<const SdPage*>(pSdrPage);
if (pPage == nullptr) if (pPage == nullptr)
return; return;
...@@ -106,6 +109,9 @@ void SelectionObserver::EndObservation() ...@@ -106,6 +109,9 @@ void SelectionObserver::EndObservation()
OSL_ASSERT(mbIsOvservationActive); OSL_ASSERT(mbIsOvservationActive);
mbIsOvservationActive = false; mbIsOvservationActive = false;
if (!mbPageEventOccurred)
return;
PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector()); PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
PageSelector::UpdateLock aUpdateLock (mrSlideSorter); PageSelector::UpdateLock aUpdateLock (mrSlideSorter);
rSelector.DeselectAllPages(); rSelector.DeselectAllPages();
......
...@@ -66,6 +66,7 @@ public: ...@@ -66,6 +66,7 @@ public:
private: private:
SlideSorter& mrSlideSorter; SlideSorter& mrSlideSorter;
bool mbIsOvservationActive; bool mbIsOvservationActive;
bool mbPageEventOccurred;
::std::vector<const SdPage*> maInsertedPages; ::std::vector<const SdPage*> maInsertedPages;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment