sd/qa/unit/data/slide_with_text.odp |binary
 sd/qa/unit/misc-tests.cxx           |   25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

New commits:
commit bfb276f79b797d8b69d01b205bd037dba9b874ca
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Mon Feb 16 11:18:24 2026 +0100
Commit:     Jaume Pujantell <[email protected]>
CommitDate: Wed Feb 25 09:43:17 2026 +0100

    sd: duplicate and move test
    
    Commit 4db90da301cff5b4bcedbe492d12bfa10e7577b7 (tdf#45617 Refactor the
    member function SdDrawDocument::InsertBookmarkAsPage) added a past/move
    error and commit 54defd512cf9a5aa5453967c784661399d9f74d0 (cid#1645527
    Copy-paste error) fixed. This is a test to try to avoid similar
    regressions.
    
    Change-Id: Idf07e3b25e9d9625866b3c33528af000de7d783e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199465
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 89f6f39887e6dc24d4343a6f9f6970ed19cabd60)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199490
    Tested-by: Jenkins
    Reviewed-by: Jaume Pujantell <[email protected]>
    (cherry picked from commit 86ef1791b2ff2972e46d4c9138df688daa6b4993)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200220

diff --git a/sd/qa/unit/data/slide_with_text.odp 
b/sd/qa/unit/data/slide_with_text.odp
new file mode 100644
index 000000000000..271dbb023807
Binary files /dev/null and b/sd/qa/unit/data/slide_with_text.odp differ
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 9da73ca3384d..025c01132574 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -96,6 +96,7 @@ public:
     void testTdf157117();
     void testPageBackgroundImages();
     void testCanvasSlideExportODP();
+    void testDuplicateAndMove();
 
     CPPUNIT_TEST_SUITE(SdMiscTest);
     CPPUNIT_TEST(testTdf99396);
@@ -124,6 +125,7 @@ public:
     CPPUNIT_TEST(testTdf157117);
     CPPUNIT_TEST(testPageBackgroundImages);
     CPPUNIT_TEST(testCanvasSlideExportODP);
+    CPPUNIT_TEST(testDuplicateAndMove);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1269,6 +1271,29 @@ void SdMiscTest::testCanvasSlideExportODP()
                        u"true");
 }
 
+void SdMiscTest::testDuplicateAndMove()
+{
+    createSdImpressDoc("slide_with_text.odp");
+    SdXImpressDocument* pXImpressDocument = 
dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pXImpressDocument);
+    sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+
+    SdPage* pFirstPage = pViewShell->GetActualPage();
+
+    dispatchCommand(mxComponent, u".uno:DuplicatePage"_ustr, {});
+    dispatchCommand(mxComponent, u".uno:DuplicatePage"_ustr, {});
+    dispatchCommand(mxComponent, u".uno:DuplicatePage"_ustr, {});
+    pXImpressDocument->setPart(2);
+    dispatchCommand(mxComponent, u".uno:MovePageLast"_ustr, {});
+
+    pXImpressDocument->setPart(3);
+    SdPage* pLastPage = pViewShell->GetActualPage();
+    // Without the fix in place, the textbox changes size
+    // - Expected: 25200x2630@(1400,628)
+    // - Actual  : 19799x11137@(600,2257)
+    CPPUNIT_ASSERT_EQUAL(pFirstPage->GetObj(0)->GetSnapRect(), 
pLastPage->GetObj(0)->GetSnapRect());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();

Reply via email to