summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-01 16:45:03 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-10-08 15:22:50 +0000
commit1eba4cd1e95d13d256378cdf736c00a36d1fdea3 (patch)
tree93984a67c5105ec4b4c20ff771ad94c142c4ca36
parentfd41d725b596968e04fc4788a4481d7dc7e488df (diff)
fdo#84536 RTF import: don't try to rotate TextFrames
Regression from 818d80eb0cee65d1bcc4fdb74b32a7c42cc1336e (RTF import: support shapes inside tables, 2013-06-28). (cherry picked from commit 53b9a9bc7c84738545b5c7b791cea1e3d6a16c72) Change-Id: I05eb2f4f2e3467e35f96b280e3a79f69906a56de Reviewed-on: https://gerrit.libreoffice.org/11746 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/qa/core/data/rtf/pass/fdo84536.rtf16
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx5
2 files changed, 20 insertions, 1 deletions
diff --git a/sw/qa/core/data/rtf/pass/fdo84536.rtf b/sw/qa/core/data/rtf/pass/fdo84536.rtf
new file mode 100644
index 000000000000..a8eaacf0d869
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo84536.rtf
@@ -0,0 +1,16 @@
+{\rtf1
+{\shp
+{\*\shpinst\shpleft0\shptop0\shpright10557\shpbottom2639\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz2\shplid2054
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn rotation}
+{\sv -2949120}
+}
+{\shptxt hello\par}
+}
+}
+\par
+}
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 19353fbe60ff..3d62a44741c2 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@@ -195,7 +196,9 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, const O
// See DffPropertyReader::Fix16ToAngle(): in RTF, positive rotation angles are clockwise, we have them as counter-clockwise.
// Additionally, RTF type is 0..360*2^16, our is 0..360*100.
sal_Int32 nRotation = aValue.toInt32()*100/65536;
- xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1))));
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY);
+ if (!xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
+ xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1))));
}
if (nHoriOrient != 0 && xPropertySet.is())