diff --git a/sw/qa/extras/ww8export/data/tdf56321_flipImage_both.doc b/sw/qa/extras/ww8export/data/tdf56321_flipImage_both.doc new file mode 100644 index 000000000000..a5293f29f526 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf56321_flipImage_both.doc differ diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index ec0387388e0d..38c0ebffcd69 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -23,7 +23,9 @@ #include #include #include +#include #include +#include #include #include @@ -567,6 +569,24 @@ DECLARE_WW8EXPORT_TEST(testTextVerticalAdjustment, "tdf36117_verticalAdjustment. CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_BLOCK, nVA ); } +DECLARE_WW8EXPORT_TEST(testRES_MIRROR_GRAPH_BOTH, "tdf56321_flipImage_both.doc") +{ + SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDoc); + + for (int n = 0; ; n++) + { + SwNode* pNode = pDoc->GetNodes()[ n ]; + if (SwGrfNode *pGrfNode = pNode->GetGrfNode()) + { + CPPUNIT_ASSERT(pGrfNode->GetSwAttrSet().GetMirrorGrf().GetValue() == 3); + break; + } + } +} + DECLARE_WW8EXPORT_TEST(testCommentExport, "comment-export.odt") { struct TextPortionInfo { diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 22f7510738a7..7c480d4ea5c3 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2094,6 +2094,24 @@ SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord, pGrfNd->SetAttr( aCrop ); } + bool bFlipH = pRecord->nFlags & SHAPEFLAG_FLIPH; + bool bFlipV = pRecord->nFlags & SHAPEFLAG_FLIPV; + if ( bFlipH || bFlipV ) + { + SwMirrorGrf aMirror = pGrfNd->GetSwAttrSet().GetMirrorGrf(); + if( bFlipH ) + { + if( bFlipV ) + aMirror.SetValue(RES_MIRROR_GRAPH_BOTH); + else + aMirror.SetValue(RES_MIRROR_GRAPH_VERT); + } + else + aMirror.SetValue(RES_MIRROR_GRAPH_HOR); + + pGrfNd->SetAttr( aMirror ); + } + if (pRecord->pObj) { const SfxItemSet& rOldSet = pRecord->pObj->GetMergedItemSet();