Blame SOURCES/0001-only-set-cur.-page-once-when-removing-mult.-pages.patch

f325b2
From 3643ea7b660a1f8263d05ffa9be47e8180fd2504 Mon Sep 17 00:00:00 2001
f325b2
From: David Tardon <dtardon@redhat.com>
f325b2
Date: Thu, 5 May 2016 17:47:03 +0200
f325b2
Subject: [PATCH] only set cur. page once when removing mult. pages
f325b2
f325b2
Change-Id: Id9da135a91d9591eed04fb25d2891169c45ecaaf
f325b2
---
f325b2
 .../ui/slidesorter/controller/SlsSelectionManager.cxx    | 16 ++++++++++++++++
f325b2
 1 file changed, 16 insertions(+)
f325b2
f325b2
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
f325b2
index 0768a1e..1e913b3 100644
f325b2
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
f325b2
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
f325b2
@@ -36,6 +36,9 @@
f325b2
 #include "view/SlideSorterView.hxx"
f325b2
 #include "view/SlsLayouter.hxx"
f325b2
 #include "drawdoc.hxx"
f325b2
+#include "drawview.hxx"
f325b2
+#include "DrawViewShell.hxx"
f325b2
+#include "ViewShellBase.hxx"
f325b2
 #include "Window.hxx"
f325b2
 #include <svx/svxids.hrc>
f325b2
 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
f325b2
@@ -117,6 +120,13 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
f325b2
     else
f325b2
         --nNewCurrentSlide;
f325b2
 
f325b2
+    const auto pViewShell = mrSlideSorter.GetViewShell();
f325b2
+    const auto pDrawViewShell = pViewShell ? dynamic_cast<sd::DrawViewShell*>(pViewShell->GetViewShellBase().GetMainViewShell().get()) : nullptr;
f325b2
+    const auto pDrawView = pDrawViewShell ? dynamic_cast<sd::DrawView*>(pDrawViewShell->GetDrawView()) : nullptr;
f325b2
+
f325b2
+    if (pDrawView)
f325b2
+        pDrawView->BlockPageOrderChangedHint(true);
f325b2
+
f325b2
     // The actual deletion of the selected pages is done in one of two
f325b2
     // helper functions.  They are specialized for normal respectively for
f325b2
     // master pages.
f325b2
@@ -129,6 +139,12 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
f325b2
 
f325b2
     mrController.HandleModelChange();
f325b2
     aLock.Release();
f325b2
+    if (pDrawView)
f325b2
+    {
f325b2
+        assert(pDrawViewShell);
f325b2
+        pDrawView->BlockPageOrderChangedHint(false);
f325b2
+        pDrawViewShell->ResetActualPage();
f325b2
+    }
f325b2
 
f325b2
     // Show focus and move it to next valid location.
f325b2
     if (bIsFocusShowing)
f325b2
-- 
f325b2
2.7.4
f325b2