[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 3 15:38:50 UTC 2020
sw/qa/extras/uiwriter/data3/tdf135661.odt |binary
sw/qa/extras/uiwriter/uiwriter3.cxx | 27 +++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
New commits:
commit 3b8ce74e48703877c73c7bcdb5ada1fbee74cc81
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Sep 3 14:28:22 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Sep 3 17:38:07 2020 +0200
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 at libreoffice.org>
diff --git a/sw/qa/extras/uiwriter/data3/tdf135661.odt b/sw/qa/extras/uiwriter/data3/tdf135661.odt
new file mode 100644
index 000000000000..7fe6a3ca4d56
Binary files /dev/null and b/sw/qa/extras/uiwriter/data3/tdf135661.odt differ
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");
More information about the Libreoffice-commits
mailing list