diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-03 14:28:22 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-03 17:38:07 +0200 |
commit | 3b8ce74e48703877c73c7bcdb5ada1fbee74cc81 (patch) | |
tree | 79610e730c6fa816a319c0987ae08fbccab4cab2 | |
parent | ea061cbe1bfb912c692473bb5e2755b3e15ac375 (diff) |
tdf#135661: sw_uiwriter: Add unittest
Change-Id: Iebf3400cba788b5c499d3aec70d5c1ce2e139a7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101999
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf135661.odt | bin | 0 -> 10800 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf135661.odt b/sw/qa/extras/uiwriter/data3/tdf135661.odt Binary files differnew file mode 100644 index 000000000000..7fe6a3ca4d56 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf135661.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index df37d45cc8e9..6e02006ea3c0 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1363,6 +1363,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf127652) CPPUNIT_ASSERT_EQUAL_MESSAGE("We are on the wrong page!", assertPage, currentPage); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135661) +{ + load(DATA_DIRECTORY, "tdf135661.odt"); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3424), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1545), xShape->getPosition().Y); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + dispatchCommand(mxComponent, ".uno:Cut", {}); + + CPPUNIT_ASSERT_EQUAL(0, getShapes()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + xShape.set(getShape(1), uno::UNO_QUERY); + + //Without the fix in place, the shape position would have been 0,0 + CPPUNIT_ASSERT_EQUAL(sal_Int32(3424), xShape->getPosition().X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1545), xShape->getPosition().Y); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477) { load(DATA_DIRECTORY, "tdf133477.fodt"); |