diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-11-27 17:14:13 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-12-02 14:49:47 +0100 |
commit | 5ce09e923a5419acb6700cea055f9d350e8f0e51 (patch) | |
tree | 8292d7eb48fbb79b707eb82782dbe5951f83e031 /writerfilter | |
parent | 6ebef0ebf6f59302fb28271acca64139164a99e5 (diff) |
Related: tdf#128611 RTF import: handle vertical flip of line shapes
UI uses SdrEditView::MirrorMarkedObjVertical() to flip a line shape
vertically, handle it similarly at import time as well.
Also note that this flips in-place, while the naive '*= -1' for the
height would have an incorrect vertical position.
(cherry picked from commit f9f421b7beaf117968c0dbfd84a2dad3dc85136a)
Change-Id: I42b7feb5f799b99337ddec734dcf98dd1d553755
Reviewed-on: https://gerrit.libreoffice.org/84209
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 2545b93c552c..85f61129b1f3 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -45,6 +45,9 @@ #include <oox/helper/propertyset.hxx> #include <boost/logic/tribool.hpp> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <svx/unoapi.hxx> +#include <svx/svdobj.hxx> + #include <dmapper/GraphicZOrderHelper.hxx> #include "rtfdocumentimpl.hxx" @@ -1046,6 +1049,22 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap "CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList())); } + else if (SdrObject* pObject = GetSdrObjectFromXShape(xShape)) + { + Point aRef1 = pObject->GetSnapRect().Center(); + Point aRef2(aRef1); + if (obFlipH == true) + { + // Horizontal mirror means a vertical reference line. + aRef2.AdjustY(1); + } + if (obFlipV == true) + { + // Vertical mirror means a horizontal reference line. + aRef2.AdjustX(1); + } + pObject->Mirror(aRef1, aRef2); + } } if (rShape.getHoriOrientRelation() != 0) |