[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 28 20:04:39 UTC 2020


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

New commits:
commit 3a560c35bd7b652cc956d808b1f451f859c924d4
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jun 18 10:24:44 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jul 28 22:04:05 2020 +0200

    tdf#132944: sw_uiwriter: Add unittest
    
    Change-Id: I45568da4b3dccd4e0cfe990c50217012f02540c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96590
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit c7f7bbf082806ba74eb5a608bfeabd05bf73510d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99642
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/extras/uiwriter/data3/tdf132944.odt b/sw/qa/extras/uiwriter/data3/tdf132944.odt
new file mode 100644
index 000000000000..08c3562aeaf1
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf132944.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index cdb1e5c3bb41..4196840ebfe5 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -428,6 +428,27 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685)
     CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132944)
+{
+    load(DATA_DIRECTORY, "tdf132944.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    dispatchCommand(mxComponent, ".uno:Delete", {});
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    Scheduler::ProcessEventsToIdle();
+
+    // Without the fix in place, the document would have had 2 pages
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130680)
 {
     load(DATA_DIRECTORY, "tdf130680.odt");


More information about the Libreoffice-commits mailing list