summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-29 16:20:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-29 21:51:51 +0100
commit4bdbb5502f5995727017e22bb8a74b9f45552067 (patch)
tree6d961813ebad828e17186f8fd39d37e9c8bd64f8 /sw/source/filter/ww8/docxattributeoutput.cxx
parentf06d75ae96a1b54207cb2cf9aecf35b4d29c2e59 (diff)
DOCX import: handle horizontal flip of bitmaps
Horizontal mirror on the UNO API level, mirror on the vertical axis internally. Change-Id: If142274a8f81a6875059a2651af6d8470870a36a Reviewed-on: https://gerrit.libreoffice.org/48843 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b0d3060ea8a9..e24b02e9dd55 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -125,6 +125,7 @@
#include <IDocumentSettingAccess.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include <IDocumentRedlineAccess.hxx>
+#include <grfatr.hxx>
#include <osl/file.hxx>
#include <vcl/embeddedfontshelper.hxx>
@@ -4713,8 +4714,21 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size
m_pSerializer->startElementNS( XML_pic, XML_spPr,
XML_bwMode, "auto",
FSEND );
- m_pSerializer->startElementNS( XML_a, XML_xfrm,
- FSEND );
+
+ rtl::Reference<sax_fastparser::FastAttributeList> xFrameAttributes(
+ FastSerializerHelper::createAttrList());
+
+ if (pGrfNode)
+ {
+ MirrorGraph eMirror = pGrfNode->GetSwAttrSet().Get(RES_GRFATR_MIRRORGRF).GetValue();
+ if (eMirror == MirrorGraph::Vertical || eMirror == MirrorGraph::Both)
+ // Mirror on the vertical axis is a horizontal flip.
+ xFrameAttributes->add(XML_flipH, "1");
+ }
+
+ m_pSerializer->startElementNS(
+ XML_a, XML_xfrm, uno::Reference<xml::sax::XFastAttributeList>(xFrameAttributes.get()));
+
m_pSerializer->singleElementNS( XML_a, XML_off,
XML_x, "0", XML_y, "0",
FSEND );