diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-11 13:03:29 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-11 15:16:25 +0100 |
commit | c1137082458cd982eb70393e13e60fc09d31958b (patch) | |
tree | 335510098b2488467e0922d74b0bc1bd1709f11b /sw/qa | |
parent | cf2a5399289c29f0e12b025a9efbaf0fe0d8ce4d (diff) |
tdf#138482: sw_uiwriter3: Add unittest
Change-Id: Ic8c175572ca5554673a802a26b696bcf7ac07f54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110761
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf138482.docx | bin | 0 -> 18955 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf138482.docx b/sw/qa/extras/uiwriter/data3/tdf138482.docx Binary files differnew file mode 100644 index 000000000000..7bb4623e2c0c --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf138482.docx diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index b755378b0b72..a24cdb3329f5 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -150,6 +150,28 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135412) CPPUNIT_ASSERT_EQUAL(OUString("X"), xShape->getString()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf138482) +{ + load(DATA_DIRECTORY, "tdf138482.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Delete", {}); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(2, getShapes()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911) { load(DATA_DIRECTORY, "tdf132911.odt"); |