diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx | bin | 0 -> 14408 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 18 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 11 |
4 files changed, 33 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx b/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx Binary files differnew file mode 100644 index 000000000000..2f95a2b8583b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/graphic-object-fliph.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index fcb662e93286..5a6cfd48cf13 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -170,6 +170,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx") "HoriOrientPosition")); } +DECLARE_OOXMLEXPORT_TEST(testGraphicObjectFliph, "graphic-object-fliph.docx") +{ + CPPUNIT_ASSERT(getProperty<bool>(getShape(1), "HoriMirroredOnEvenPages")); + CPPUNIT_ASSERT(getProperty<bool>(getShape(1), "HoriMirroredOnOddPages")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf113547, "tdf113547.docx") { uno::Reference<beans::XPropertySet> xPropertySet( 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 ); diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 295e3f1a8164..a6452c3d1a7a 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1334,6 +1334,17 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b m_pImpl->applyMargins(xGraphicObjectProperties); m_pImpl->applyName(xGraphicObjectProperties); } + + // Handle horizontal flip. + bool bMirrored = false; + xShapeProps->getPropertyValue("IsMirrored") >>= bMirrored; + if (bMirrored) + { + xGraphicObjectProperties->setPropertyValue("HoriMirroredOnEvenPages", + uno::makeAny(true)); + xGraphicObjectProperties->setPropertyValue("HoriMirroredOnOddPages", + uno::makeAny(true)); + } } } catch( const uno::Exception& e ) |