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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 23 07:24:58 UTC 2020


 sw/qa/extras/uiwriter/data3/tdf129805.docx |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx        |   17 +++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 2fe1ecae8a7937adffdf8f5e3bd9fe6f8b7de1e3
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Apr 22 16:53:47 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Thu Apr 23 09:24:20 2020 +0200

    tdf#129805: sw: Add unittest
    
    Change-Id: Ie1b36fb51310d0073fec31c7963cbeedc847f953
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92709
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/data3/tdf129805.docx b/sw/qa/extras/uiwriter/data3/tdf129805.docx
new file mode 100644
index 000000000000..53cb5550df6d
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf129805.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 4b11d29637d3..ebecddedbb16 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -335,6 +335,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130746)
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129805)
+{
+    load(DATA_DIRECTORY, "tdf129805.docx");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    CPPUNIT_ASSERT_EQUAL(OUString("x"), getParagraph(1)->getString());
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    // without the fix in place, it would crash here
+    dispatchCommand(mxComponent, ".uno:Cut", {});
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+    CPPUNIT_ASSERT_EQUAL(OUString("x"), getParagraph(1)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf130685)
 {
     load(DATA_DIRECTORY, "tdf130685.odt");


More information about the Libreoffice-commits mailing list