[Libreoffice-commits] core.git: sd/qa sd/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 1 22:32:57 UTC 2021
sd/qa/unit/uiimpress.cxx | 33 ++++++++++++
sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx | 2
2 files changed, 34 insertions(+), 1 deletion(-)
New commits:
commit 58814d047be09d6bd31da5dfd0efe3bae593c4d5
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Feb 1 14:13:30 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Feb 1 23:32:17 2021 +0100
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 at libreoffice.org>
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
More information about the Libreoffice-commits
mailing list