sd/qa/unit/uiimpress.cxx |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 925f9a9111eb8c856869e9b2b9eeb220ab21430d
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Nov 30 12:40:17 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Nov 30 16:21:02 2022 +0100

    CppunitTest_sd_uiimpress: fix asserts
    
    we want to check the number of shapes, not the number
    of pages
    
    Change-Id: If83a9be71bc796ae0cb5fe005780a78428ade9f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143485
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 32ea8642e2ed..13f072cf2488 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -861,13 +861,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669)
     Scheduler::ProcessEventsToIdle();
 
     uno::Reference<drawing::XDrawPagesSupplier> 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xDraws = 
xDrawPagesSupplier->getDrawPages();
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+    uno::Reference<drawing::XDrawPage> 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+                                                 uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
 
     typeString(pImpressDocument, u"°");
 
-    uno::Reference<drawing::XDrawPage> 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
-                                                 uno::UNO_QUERY);
     uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(2), 
uno::UNO_QUERY);
     // Without the fix in place, this test would have failed with:
     // - Expected: °
@@ -912,14 +911,11 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
     Scheduler::ProcessEventsToIdle();
 
     uno::Reference<drawing::XDrawPagesSupplier> 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> xDraws = 
xDrawPagesSupplier->getDrawPages();
-
-    int getShapes = xDraws->getCount();
-    CPPUNIT_ASSERT_EQUAL(1, getShapes);
-
     uno::Reference<drawing::XDrawPage> 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
                                                  uno::UNO_QUERY);
 
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDrawPage->getCount());
+
     for (int i = 0; i < 3; i++)
     {
         uno::Reference<beans::XPropertySet> XPropSet(xDrawPage->getByIndex(i), 
uno::UNO_QUERY);

Reply via email to