diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-16 09:13:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-16 08:32:20 +0000 |
commit | 63965d7dc571c7dce999980737f9d57a7c5151da (patch) | |
tree | e851a749f6604e8835486f77cb9f4798cd59711b /writerfilter | |
parent | b0a9ba98ba83154680f8aea0fd0e58b85e2cfb04 (diff) |
tdf#91684 RTF import: handle fFlipH and fFlipV shape props
Change-Id: I930f99647de00c2e43ef94b1ac0320daa440eae9
Reviewed-on: https://gerrit.libreoffice.org/26349
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index d9d99fb852a4..c70050fe1155 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -351,6 +351,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap sal_Int16 nRelativeWidthRelation = text::RelOrientation::PAGE_FRAME; sal_Int16 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME; boost::logic::tribool obRelFlipV(boost::logic::indeterminate); + boost::logic::tribool obFlipH(boost::logic::indeterminate); + boost::logic::tribool obFlipV(boost::logic::indeterminate); bool bCustom(false); int const nType = initShape(xShape, xPropertySet, bCustom, rShape, bClose, shapeOrPict); @@ -783,6 +785,10 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap } else if (rProperty.first == "fRelFlipV") obRelFlipV = rProperty.second.toInt32() == 1; + else if (rProperty.first == "fFlipH") + obFlipH = rProperty.second.toInt32() == 1; + else if (rProperty.first == "fFlipV") + obFlipV = rProperty.second.toInt32() == 1; else SAL_INFO("writerfilter", "TODO handle shape property '" << rProperty.first << "':'" << rProperty.second << "'"); } @@ -908,6 +914,17 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap else xShape->setSize(awt::Size(rShape.nRight - rShape.nLeft, rShape.nBottom - rShape.nTop)); + if (obFlipH == true || obFlipV == true) + { + // This has to be set after position and size is set, otherwise flip will affect the position. + comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + if (obFlipH == true) + aCustomShapeGeometry["MirroredX"] <<= true; + if (obFlipV == true) + aCustomShapeGeometry["MirroredY"] <<= true; + xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList())); + } + if (rShape.nHoriOrientRelation != 0) xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation)); if (rShape.nVertOrientRelation != 0) |