diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-06-30 17:08:10 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-07-01 09:37:15 +0200 |
commit | f70b001fb10861e542bca1e736a376016c7b8260 (patch) | |
tree | e47649a87db97870d804b477d98a3aeb94386a6b | |
parent | 7df1884118a0d995ec57679ef83e586c95063858 (diff) |
tdf#134404: sw: Add unittest
Change-Id: I81e46e06ad7964e52b45ce3433a25758cc7d19fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97534
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf134404.odt | bin | 0 -> 9928 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf134404.odt b/sw/qa/extras/uiwriter/data3/tdf134404.odt Binary files differnew file mode 100644 index 000000000000..53875f13822a --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf134404.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 43f181678833..db45c779d04e 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -56,6 +56,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) CPPUNIT_ASSERT_EQUAL(8, getShapes()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134404) +{ + load(DATA_DIRECTORY, "tdf134404.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + dispatchCommand(mxComponent, ".uno:GoToEndOfPage", {}); + Scheduler::ProcessEventsToIdle(); + dispatchCommand(mxComponent, ".uno:InsertPagebreak", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + dispatchCommand(mxComponent, ".uno:SwBackspace", {}); + Scheduler::ProcessEventsToIdle(); + + // Without the fix in place, the image would have been deleted + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321) { load(DATA_DIRECTORY, "tdf132321.odt"); |