summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport/rtfimport.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-04-21 12:17:27 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-21 13:02:16 +0200
commit7546a904265cc0d0a0e3795cdb411cbb945a39fe (patch)
treeed6870b3998d89c0ecca8b5240287447fe5ba86e /sw/qa/extras/rtfimport/rtfimport.cxx
parent59cea45ec247df1acb691308c940ff97673e4c48 (diff)
RTF import: handle d{x,y}WrapDist* picture properties
Commit e789c7f0f15a6b571de95b81e77e3a323e9f540e (RTF import of d{x,y}WrapDist* shape properties, 2013-04-09) added support for wrap distance of shapes, but that was ignored for shapes, as dmapper later overwrote the set margins. Fix this by generating the expected tokens in case of pictures, then dmapper will take care of the rest. Also add testcases for the original shape wrap distance feature that was missing. Change-Id: I6f219ee6fef71328368409d142897dbae77a0f2f
Diffstat (limited to 'sw/qa/extras/rtfimport/rtfimport.cxx')
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f4c14c77b63a..ae2873e2a120 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2245,6 +2245,24 @@ DECLARE_RTFIMPORT_TEST(testTdf86182, "tdf86182.rtf")
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(getParagraph(1), "WritingMode"));
}
+DECLARE_RTFIMPORT_TEST(testWrapDistance, "wrap-distance.rtf")
+{
+ // Custom shape, handled directly in RTFSdrImport.
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), xShape->getShapeType());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), getProperty<sal_Int32>(xShape, "TopMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), getProperty<sal_Int32>(xShape, "BottomMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), getProperty<sal_Int32>(xShape, "LeftMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), getProperty<sal_Int32>(xShape, "RightMargin") / 1000);
+
+ // Picture, handled in GraphicImport, shared with DOCX.
+ xShape = getShape(2);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), getProperty<sal_Int32>(xShape, "TopMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), getProperty<sal_Int32>(xShape, "BottomMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), getProperty<sal_Int32>(xShape, "LeftMargin") / 1000);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), getProperty<sal_Int32>(xShape, "RightMargin") / 1000);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */