From 54031e6a2912ebe723b4423b5d737c13c9bb03c5 Mon Sep 17 00:00:00 2001 From: Bakos Attila Date: Fri, 10 Jul 2020 12:42:11 +0200 Subject: tdf#132483: DOCX import: fix OLE anchoring position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The relative orientation of OLE objects was not copied from the replacement object to OLE, resulting bad position. Co-authored-by: Attila Bánhegyi (NISZ) Change-Id: If62124e5a40218a224e047efbe86a09606b44af5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98493 Tested-by: László Németh Reviewed-by: László Németh --- sw/qa/extras/ooxmlexport/data/tdf132483.docx | Bin 0 -> 21183 bytes sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf132483.docx (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmlexport/data/tdf132483.docx b/sw/qa/extras/ooxmlexport/data/tdf132483.docx new file mode 100644 index 000000000000..e4ebf4b78511 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf132483.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 67e9a9555b24..27e2f22c2dbc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -10,6 +10,7 @@ #include #include +#include char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; @@ -73,6 +74,19 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter, CPPUNIT_ASSERT_EQUAL(static_cast(1147), nAnchoredHeight); } +DECLARE_OOXMLIMPORT_TEST(TestTdf132483, "tdf132483.docx") +{ + uno::Reference xOLEProps(getShape(1), uno::UNO_QUERY_THROW); + sal_Int16 nVRelPos = -1; + sal_Int16 nHRelPos = -1; + xOLEProps->getPropertyValue("VertOrientRelation") >>= nVRelPos; + xOLEProps->getPropertyValue("HoriOrientRelation") >>= nHRelPos; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The OLE is shifted vertically", + text::RelOrientation::PAGE_FRAME , nVRelPos); + CPPUNIT_ASSERT_EQUAL_MESSAGE("The OLE is shifted horizontally", + text::RelOrientation::PAGE_FRAME , nHRelPos); +} + DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginNoFooter, "tdf133070_testRelativeAnchorHeightFromBottomMarginNoFooter.docx") { -- cgit