diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-06-03 14:28:36 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-06-03 17:14:28 +0200 |
commit | c9faea128e46a5284948343f4f2cfc6f9e9174b8 (patch) | |
tree | 8475cb5313eef67de05357510aac55c4d9530906 | |
parent | bc6327c1c2ce8823483f286bf7a00eab4f2938a4 (diff) |
tdf#132420: sw: Add unittest
Change-Id: Ic98667b688c8d865e637fb921913a2d8d57133f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95431
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-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"); |