[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source
Szabolcs (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 14 10:57:16 UTC 2020
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 <szabolcs450 at gmail.com>
AuthorDate: Tue Mar 24 15:38:14 2020 +0100
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
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 <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit 08a11f8fe19560b000c62da00d7425b4f500d605)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92166
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
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
More information about the Libreoffice-commits
mailing list