summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport/rtfexport.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-03 21:09:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-03 21:25:00 +0200
commitf332db6864c1c0f28feb64a7f79b9b4ef3c76b58 (patch)
tree4279d476de7a35dbb19a3722f7f8ac58a26845de /sw/qa/extras/rtfexport/rtfexport.cxx
parent34580851065fc04af25e9c83a1106d1478f159e0 (diff)
RTF export: handle wrap polygon of Writer pictures
Change-Id: I712d8f73466c662659a7b76ff363a44a71bba324
Diffstat (limited to 'sw/qa/extras/rtfexport/rtfexport.cxx')
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 644abaae7a08..63df38948632 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
@@ -664,6 +665,21 @@ DECLARE_RTFEXPORT_TEST(testFdo32613, "fdo32613.odt")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
+DECLARE_RTFEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.rtf")
+{
+ // The problem was that the wrap polygon was ignored during import.
+ drawing::PointSequenceSequence aSeqSeq = getProperty<drawing::PointSequenceSequence>(getShape(1), "ContourPolyPolygon");
+ // This was 0: the polygon list was empty.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength());
+
+ drawing::PointSequence aSeq = aSeqSeq[0];
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength());
+
+ // The shape also didn't have negative top / left coordinates.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)), getProperty<sal_Int32>(getShape(1), "HoriOrientPosition"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)), getProperty<sal_Int32>(getShape(1), "VertOrientPosition"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();