[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 1 07:38:00 UTC 2020


 sw/qa/extras/uiwriter/data3/tdf134404.odt |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx       |   31 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

New commits:
commit f70b001fb10861e542bca1e736a376016c7b8260
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jun 30 17:08:10 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jul 1 09:37:15 2020 +0200

    tdf#134404: sw: Add unittest
    
    Change-Id: I81e46e06ad7964e52b45ce3433a25758cc7d19fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97534
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data3/tdf134404.odt b/sw/qa/extras/uiwriter/data3/tdf134404.odt
new file mode 100644
index 000000000000..53875f13822a
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf134404.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 43f181678833..db45c779d04e 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -56,6 +56,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
     CPPUNIT_ASSERT_EQUAL(8, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404)
+{
+    load(DATA_DIRECTORY, "tdf134404.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {});
+    Scheduler::ProcessEventsToIdle();
+    dispatchCommand(mxComponent, ".uno:InsertPagebreak", {});
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+    dispatchCommand(mxComponent, ".uno:SwBackspace", {});
+    Scheduler::ProcessEventsToIdle();
+
+    // Without the fix in place, the image would have been deleted
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321)
 {
     load(DATA_DIRECTORY, "tdf132321.odt");


More information about the Libreoffice-commits mailing list