diff options
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf135662.odt | bin | 0 -> 13627 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf135662.odt b/sw/qa/extras/uiwriter/data/tdf135662.odt Binary files differnew file mode 100644 index 000000000000..d65725bda510 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf135662.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 47407eaf7149..944cb3b3f33b 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -83,6 +83,32 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382) CPPUNIT_ASSERT_EQUAL(8, getShapes()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135662) +{ + load(DATA_DIRECTORY, "tdf135662.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(2, getShapes()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + + SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell); + xTransfer->Cut(); + + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + + TransferableDataHelper aHelper(xTransfer); + SwTransferable::Paste(*pWrtShell, aHelper); + + // Without the fix in place, this test would have failed with + // - Expected: 2 + // - Actual : 1 + CPPUNIT_ASSERT_EQUAL(2, getShapes()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf134227) { load(DATA_DIRECTORY, "tdf134227.docx"); |