summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf133990.odtbin0 -> 17859 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf133990.odt b/sw/qa/extras/uiwriter/data3/tdf133990.odt
new file mode 100644
index 000000000000..8eaca8161701
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf133990.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 95d72d82f9a3..dda897ee2ee3 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -179,6 +179,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261)
getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL"));
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, 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
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+
+ dispatchCommand(mxComponent, ".uno:Delete", {});
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
+
+ //Without the fix in place, it would have crashed here
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xIndexAccess->getCount());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133982)
{
load(DATA_DIRECTORY, "tdf133982.docx");