[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 27 12:57:03 UTC 2020


 sw/qa/extras/uiwriter/data/tdf133990.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx       |   27 +++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

New commits:
commit 61d83ce8d29aa6dc1039df8e7f8c5afdbf42a266
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Jun 19 12:46:30 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue Oct 27 13:56:29 2020 +0100

    tdf#133990: sw: Add unittest
    
    Change-Id: I3b5d1a2a2396fba9d350350ac4d04f7f97401ebe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96714
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit 8e4c79472644452431381733a5e4b21f98fcdcf3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104823
    Tested-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/extras/uiwriter/data/tdf133990.odt b/sw/qa/extras/uiwriter/data/tdf133990.odt
new file mode 100644
index 000000000000..8eaca8161701
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf133990.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 623f7bec96eb..f3f43f193310 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -6004,6 +6004,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf132944)
     CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf133990)
+{
+    load(DATA_DIRECTORY, "tdf133990.odt");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(),
+                                                         uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xIndexAccess->getCount());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    //Use selectAll 3 times in a row
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+    lcl_dispatchCommand(mxComponent, ".uno:Delete", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
+
+    //Without the fix in place, it would have crashed here
+    lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xIndexAccess->getCount());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 void SwUiWriterTest::testTdf106701_tabOverMarginAutotab()
 {
     createDoc("tdf106701_tabOverMarginAutotab.doc");


More information about the Libreoffice-commits mailing list