summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-08 16:21:28 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-08 17:16:10 +0200
commit2e11cb276e54c6fe4e903c7f44e36bc36798ba63 (patch)
tree60939cc9293be1aaca94f3f293008ea4eb7a7f40 /sw/qa
parent6d191c06c737e4c7f3e2c5f8b871d1037b4ce783 (diff)
Related: fdo#66040 RTF import: by default, do create a group shape for \shpgrp
The bugfix was just for the special case when we must create textframes due to the contained tables, this one add support for the default case when we want a real group shape. Change-Id: I74b77b233235959266a24660c970a79e41d8b272
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfimport/data/groupshape.rtf76
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx12
2 files changed, 88 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/groupshape.rtf b/sw/qa/extras/rtfimport/data/groupshape.rtf
new file mode 100644
index 000000000000..b237570d0937
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/groupshape.rtf
@@ -0,0 +1,76 @@
+{\rtf1
+\paperw16840\paperh11907\margl567\margr567\margt567\margb567
+{\shpgrp
+{\*\shpinst\shpleft-201\shptop-585\shpright16112\shpbottom11321
+{\sp
+{\sn groupLeft}
+{\sv 288}
+}
+{\sp
+{\sn groupTop}
+{\sv -18}
+}
+{\sp
+{\sn groupRight}
+{\sv 16601}
+}
+{\sp
+{\sn groupBottom}
+{\sv 11888}
+}
+{\shp
+{\*\shpinst
+{\sp
+{\sn relLeft}
+{\sv 288}
+}
+{\sp
+{\sn relTop}
+{\sv -18}
+}
+{\sp
+{\sn relRight}
+{\sv 8225}
+}
+{\sp
+{\sn relBottom}
+{\sv 11888}
+}
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\shptxt foo
+}
+}
+}
+{\shp
+{\*\shpinst
+{\sp
+{\sn relLeft}
+{\sv 8664}
+}
+{\sp
+{\sn relTop}
+{\sv -18}
+}
+{\sp
+{\sn relRight}
+{\sv 16601}
+}
+{\sp
+{\sn relBottom}
+{\sv 11888}
+}
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\shptxt baz
+}
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index b22e72904049..3aa8d19e2109 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -151,6 +151,7 @@ public:
void testN823675();
void testFdo47802();
void testFdo39001();
+ void testGroupshape();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -287,6 +288,7 @@ void Test::run()
{"n823675.rtf", &Test::testN823675},
{"fdo47802.rtf", &Test::testFdo47802},
{"fdo39001.rtf", &Test::testFdo39001},
+ {"groupshape.rtf", &Test::testGroupshape},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1395,6 +1397,16 @@ void Test::testFdo39001()
CPPUNIT_ASSERT_EQUAL(3, getPages());
}
+void Test::testGroupshape()
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ // There should be a single groupshape with 2 children.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
+ uno::Reference<drawing::XShapes> xGroupshape(xDraws->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupshape->getCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();