diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-01 14:13:30 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-01 23:32:17 +0100 |
commit | 58814d047be09d6bd31da5dfd0efe3bae593c4d5 (patch) | |
tree | 91a4b2761bcca3e0e09bbb21055ae1eb1041ead3 /sd | |
parent | 0108ed5cefdf259f5374d6c6aaf7ae14fea16181 (diff) |
tdf#139996: sd_uiimpress: Add unittest
Change-Id: If4a8e415fadb1d004166b2a7428aff775bc37634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110254
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 33 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx | 2 |
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 |