summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/qa/unit/uiimpress.cxx33
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx2
2 files changed, 34 insertions, 1 deletions
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 83eb2a39cd13..8b444d7f3674 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -235,6 +235,39 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197)
pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, SfxCallMode::SYNCHRON);
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf139996)
+{
+ mxComponent = loadFromDesktop("private:factory/simpress",
+ "com.sun.star.presentation.PresentationDocument");
+
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell();
+ auto& rSSController = pSSVS->GetSlideSorter().GetController();
+ auto& rPageSelector = rSSController.GetPageSelector();
+
+ CPPUNIT_ASSERT_EQUAL(1, rPageSelector.GetSelectedPageCount());
+
+ rPageSelector.DeselectAllPages();
+
+ CPPUNIT_ASSERT_EQUAL(0, rPageSelector.GetSelectedPageCount());
+
+ // Without the fix in place, this test would have crashed here
+ dispatchCommand(mxComponent, ".uno:MovePageUp", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:MovePageDown", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:MovePageTop", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:MovePageBottom", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(0, rPageSelector.GetSelectedPageCount());
+}
+
CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf128651)
{
// Error was, that undo and redo changes size of the shape. Affected actions were e.g.
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
index 5993618db157..51123f752ea9 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx
@@ -60,7 +60,7 @@ public:
// Exported for unit test
SD_DLLPUBLIC void SelectAllPages();
- void DeselectAllPages();
+ SD_DLLPUBLIC void DeselectAllPages();
/** Update the selection state of all page descriptors to be the same as
that of the corresponding pages of the SdPage objects and issue