summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-04-22 16:53:47 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2020-04-23 09:24:20 +0200
commit2fe1ecae8a7937adffdf8f5e3bd9fe6f8b7de1e3 (patch)
tree05e36b12299ffaf41f8a616f6525ba340186b385 /sw
parent539a5501e6732b5083e112e76511024c8ce9678a (diff)
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@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf129805.docxbin0 -> 20783 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx17
2 files changed, 17 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf129805.docx
Binary files 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");