summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-11-27 17:14:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-11-27 21:59:01 +0100
commitf9f421b7beaf117968c0dbfd84a2dad3dc85136a (patch)
treec0d144a99e13086358710f9bd3bfbe5203fc824d /writerfilter
parent895cd72158fc8a455f705764ae4ae000b933eba4 (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. Change-Id: I42b7feb5f799b99337ddec734dcf98dd1d553755 Reviewed-on: https://gerrit.libreoffice.org/83929 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 33d2e3a3760b..8dc10cc53622 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)