diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-12-15 10:03:27 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-12-15 12:27:38 +0100 |
commit | 41f7b1b12dfdfce508f04878409854fb9da38874 (patch) | |
tree | 338077e7b79596a2c9a11fd679f85dde4f220ef5 /sw/qa/extras | |
parent | 76f29376183be48c076ada06159581ea981de3d1 (diff) |
tdf#141175: sw_uiwriter3: Add unittest
Change-Id: Iba615528f8515fe60dc71bc61c0d815c0e1962e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126851
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf141175.odt | bin | 0 -> 9574 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf141175.odt b/sw/qa/extras/uiwriter/data/tdf141175.odt Binary files differnew file mode 100644 index 000000000000..3ccfa6b1a326 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf141175.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 22a4f329296b..ca37d6ffa53e 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -904,6 +904,36 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261) getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141175) +{ + createSwDoc(DATA_DIRECTORY, "tdf141175.odt"); + + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), 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", {}); + Scheduler::ProcessEventsToIdle(); + + //Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133990) { createSwDoc(DATA_DIRECTORY, "tdf133990.odt"); |