diff options
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf132420.odt | bin | 0 -> 11766 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf132420.odt b/sw/qa/extras/uiwriter/data3/tdf132420.odt Binary files differnew file mode 100644 index 000000000000..8e556aa5a2d4 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf132420.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 2ba1db6974d2..2a3a749401c9 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -489,6 +489,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf131684) CPPUNIT_ASSERT_EQUAL(sectionId, textUpper); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132420) +{ + load(DATA_DIRECTORY, "tdf132420.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(12, getShapes()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + //Without the fix in place, 1 frame and 1 image would be gone and getShapes would return 10 + CPPUNIT_ASSERT_EQUAL(12, getShapes()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf80663) { mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); |