summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-11-24 13:55:57 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-24 23:02:33 +0100
commitd8ac6ba98674652bd0ca317da4a0606da5adce85 (patch)
tree66a2eb7d25e373bf6d615e1339e5f20d763bc54d /sw
parent89c4bc5220810dc3684a473f87d001f2c55438a1 (diff)
td#f145621: sw_uiwriter3: Add unittest
Change-Id: I5f9584309c7ad42f43110d11d6fb3d34d8fb9898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125770 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf145621.odtbin0 -> 9238 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf145621.odt b/sw/qa/extras/uiwriter/data/tdf145621.odt
new file mode 100644
index 000000000000..d3ff8650ee89
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf145621.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 479bf9e990bf..80874d041267 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2184,6 +2184,24 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf121546)
CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145621)
+{
+ createSwDoc(DATA_DIRECTORY, "tdf145621.odt");
+
+ CPPUNIT_ASSERT_EQUAL(OUString("AAAAAA"), getParagraph(1)->getString());
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ dispatchCommand(mxComponent, ".uno:Cut", {});
+
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString());
+
+ // Without the fix in place, this test would have crashed
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+
+ CPPUNIT_ASSERT_EQUAL(OUString("AAAAAA"), getParagraph(1)->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134626)
{
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf134626.odt");