sw/qa/extras/ooxmlexport/data/tdf132483.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 14 ++++++++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-)
New commits: commit 54031e6a2912ebe723b4423b5d737c13c9bb03c5 Author: Bakos Attila <bakos.attilakar...@nisz.hu> AuthorDate: Fri Jul 10 12:42:11 2020 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon Jul 13 15:47:15 2020 +0200 tdf#132483: DOCX import: fix OLE anchoring position 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 <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> 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 <swmodeltestbase.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/text/RelOrientation.hpp> char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; @@ -73,6 +74,19 @@ DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter, CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1147), nAnchoredHeight); } +DECLARE_OOXMLIMPORT_TEST(TestTdf132483, "tdf132483.docx") +{ + uno::Reference<beans::XPropertySet> 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") { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 16b56a6ecae8..777006bb58de 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2249,7 +2249,9 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share OUString("HoriOrient"), OUString("HoriOrientPosition"), OUString("VertOrient"), - OUString("VertOrientPosition") + OUString("VertOrientPosition"), + OUString("VertOrientRelation"), + OUString("HoriOrientRelation") }; for (const OUString & s : pProperties) xOLEProperties->setPropertyValue(s, xReplacementProperties->getPropertyValue(s)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits