summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");