sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 12 ++++++++++++ sw/source/filter/ww8/docxsdrexport.cxx | 8 ++++++-- 3 files changed, 18 insertions(+), 2 deletions(-)
New commits: commit b81e6e18353b68fe41e805e9f047e787963a53f2 Author: Szabolcs <[email protected]> AuthorDate: Tue Mar 24 15:38:14 2020 +0100 Commit: Xisco Faulí <[email protected]> CommitDate: Tue Apr 14 12:56:43 2020 +0200 tdf#104565 DOCX drawing object export: fix arrow positions Saving some arrows from ODT to DOCX scattered them around their correct position. This happened because of a function that recalculates the position of drawing objects when they are rotated, according to the rotation. It turns out we don't have to do this with lines and such. Co-Author: Balázs Regényi Change-Id: Iea6a34d15003cacc27a8030cb73511aba39225f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90989 Tested-by: László Németh <[email protected]> Reviewed-by: László Németh <[email protected]> (cherry picked from commit 08a11f8fe19560b000c62da00d7425b4f500d605) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92166 Tested-by: Jenkins Reviewed-by: Xisco Faulí <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx b/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx new file mode 100644 index 000000000000..514eeddbafb8 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf104565_ArrowPosition.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 566eb076feef..8e79024c90f0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1094,6 +1094,18 @@ DECLARE_OOXMLEXPORT_TEST(testArrowFlipXY, "tdf100751_arrowBothFlip.docx") CPPUNIT_ASSERT(arrowStyle.indexOf(u"flip:xy") != sal_Int32(-1)); } +DECLARE_OOXMLEXPORT_TEST(testArrowPosition, "tdf104565_ArrowPosition.docx") +{ + // tdf#104565: Test correct position. + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // This is the correct Y coordinate, the incorrect was 817880. + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "516255"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 573db097a2b4..7cacc4eb3173 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -440,8 +440,12 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons ->getIDocumentDrawModelAccess() .GetInvisibleHellId(); - nRotation = pObj->GetRotateAngle(); - lclMovePositionWithRotation(aPos, rSize, nRotation); + // Do not do this with lines. + if (pObj->GetObjIdentifier() != OBJ_LINE) + { + nRotation = pObj->GetRotateAngle(); + lclMovePositionWithRotation(aPos, rSize, nRotation); + } } attrList->add(XML_behindDoc, bOpaque ? "0" : "1"); // Extend distance with the effect extent if the shape is not rotated, which is the opposite _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
