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

New commits:
commit 89f6f39887e6dc24d4343a6f9f6970ed19cabd60
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Mon Feb 16 11:18:24 2026 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Feb 16 15:19:44 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]>

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 bd416356a4bc..664d86a5431c 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -97,6 +97,7 @@ public:
     void testTdf157117();
     void testPageBackgroundImages();
     void testCanvasSlideExportODP();
+    void testDuplicateAndMove();
 
     CPPUNIT_TEST_SUITE(SdMiscTest);
     CPPUNIT_TEST(testTdf99396);
@@ -125,6 +126,7 @@ public:
     CPPUNIT_TEST(testTdf157117);
     CPPUNIT_TEST(testPageBackgroundImages);
     CPPUNIT_TEST(testCanvasSlideExportODP);
+    CPPUNIT_TEST(testDuplicateAndMove);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1270,6 +1272,30 @@ 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();
+
+    // SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
+    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* aLastPage = 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(), 
aLastPage->GetObj(0)->GetSnapRect());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();

Reply via email to