diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-13 10:26:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-13 11:02:19 +0200 |
commit | 774b6899172b2f803898655103d6653ef2261cfd (patch) | |
tree | 7e86ef4a9f77d1f897ff669bd576ef0781a419c0 /sw/qa | |
parent | 48a1b767b183acdc703cd7e5a4c6d492da237daa (diff) |
RTF import: handle rotation on groupshapes
Change-Id: I7892224a118b6566e26b3ffc472c88f3c7f58620
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfimport/data/groupshape-rotation.rtf | 75 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 10 |
2 files changed, 85 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/groupshape-rotation.rtf b/sw/qa/extras/rtfimport/data/groupshape-rotation.rtf new file mode 100644 index 000000000000..bf6b1fb92819 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/groupshape-rotation.rtf @@ -0,0 +1,75 @@ +{\rtf1 +{\shpgrp +{\*\shpinst\shpleft1853\shptop-442\shpright2648\shpbottom1943\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1028 +{\sp +{\sn groupLeft} +{\sv 2475} +} +{\sp +{\sn groupTop} +{\sv 1770} +} +{\sp +{\sn groupRight} +{\sv 4860} +} +{\sp +{\sn groupBottom} +{\sv 2565} +} +{\sp +{\sn rotation} +{\sv 2949120} +} +{\shp +{\*\shpinst\shplid1026 +{\sp +{\sn relLeft} +{\sv 2475} +} +{\sp +{\sn relTop} +{\sv 1770} +} +{\sp +{\sn relRight} +{\sv 3285} +} +{\sp +{\sn relBottom} +{\sv 2565} +} +{\sp +{\sn shapeType} +{\sv 2} +} +} +} +{\shp +{\*\shpinst\shplid1027 +{\sp +{\sn relLeft} +{\sv 3900} +} +{\sp +{\sn relTop} +{\sv 1770} +} +{\sp +{\sn relRight} +{\sv 4860} +} +{\sp +{\sn relBottom} +{\sv 2565} +} +{\sp +{\sn shapeType} +{\sv 5} +} +} +} +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 4e9e8818abc7..e1437c84c3f2 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -163,6 +163,7 @@ public: void testFdo47440(); void testFdo53556(); void testFdo63428(); + void testGroupshapeRotation(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -310,6 +311,7 @@ void Test::run() {"fdo47440.rtf", &Test::testFdo47440}, {"fdo53556.rtf", &Test::testFdo53556}, {"hello.rtf", &Test::testFdo63428}, + {"groupshape-rotation.rtf", &Test::testGroupshapeRotation}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1520,6 +1522,14 @@ void Test::testFdo63428() CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType")); } +void Test::testGroupshapeRotation() +{ + // Rotation on groupshapes wasn't handled correctly, RotateAngle was 4500. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty<sal_Int32>(xDraws->getByIndex(0), "RotateAngle")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |