diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-02-09 11:12:26 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-02-09 13:17:10 +0100 |
commit | ae00898f12b9087e1d9b59d9a7820d64b5501775 (patch) | |
tree | 42d95c124931168cb3e0fb0a240f1469830e7750 /sw | |
parent | 3ce68a2a7cc0fe9fe83dccd0019cd32d6518c16e (diff) |
tdf#103567 xmloff: ODF import: fix more lossage on Writer frames
There's another context that reads draw:frame, and it has the same
problem as the one used for Impress shapes. This causes SVG images
in Writer to lose contour polygons and image maps.
Fix this the same way as the other context.
(likely regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70)
Change-Id: I16cf55e68829b4e1b0841f2015d0729be0ce3725
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf103567.odt | bin | 0 -> 13562 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 36 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf103567.odt b/sw/qa/extras/odfexport/data/tdf103567.odt Binary files differnew file mode 100644 index 000000000000..cbd29bd298a5 --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf103567.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index f53ec92c9c02..e27b2da82320 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -17,6 +17,7 @@ #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/table/ShadowFormat.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/text/RelOrientation.hpp> @@ -109,6 +110,41 @@ DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx") CPPUNIT_ASSERT_EQUAL(OUString(" size 12{2+2=4} {}"), formula2); } +DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") +{ + uno::Reference<drawing::XShape> const xShape(getShape(1)); + + // contour wrap polygon + css::drawing::PointSequenceSequence const pointss( + getProperty<css::drawing::PointSequenceSequence>(xShape, "ContourPolyPolygon")); + CPPUNIT_ASSERT_EQUAL(1, pointss.getLength()); + // for some reason this property exists with 199 points if it wasn't + // imported, that would be a fail + CPPUNIT_ASSERT_EQUAL(5, pointss[0].getLength()); + CPPUNIT_ASSERT_EQUAL( 0, pointss[0][0].X); + CPPUNIT_ASSERT_EQUAL(2672, pointss[0][0].Y); + CPPUNIT_ASSERT_EQUAL( 0, pointss[0][1].X); + CPPUNIT_ASSERT_EQUAL(1111, pointss[0][1].Y); + CPPUNIT_ASSERT_EQUAL(2672, pointss[0][2].X); + CPPUNIT_ASSERT_EQUAL(1111, pointss[0][2].Y); + CPPUNIT_ASSERT_EQUAL(2672, pointss[0][3].X); + CPPUNIT_ASSERT_EQUAL(2672, pointss[0][3].Y); + CPPUNIT_ASSERT_EQUAL( 0, pointss[0][4].X); + CPPUNIT_ASSERT_EQUAL(2672, pointss[0][4].Y); + + // image map, one rectangle + uno::Reference<container::XIndexContainer> const xImageMap( + getProperty<uno::Reference<container::XIndexContainer>>(xShape, "ImageMap")); + + uno::Reference<beans::XPropertySet> const xEntry(xImageMap->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("http://example.com/"), getProperty<OUString>(xEntry, "URL")); + awt::Rectangle const rect(getProperty<awt::Rectangle>(xEntry, "Boundary")); + CPPUNIT_ASSERT_EQUAL( 726, rect.X); + CPPUNIT_ASSERT_EQUAL(1718, rect.Y); + CPPUNIT_ASSERT_EQUAL(1347, rect.Width); + CPPUNIT_ASSERT_EQUAL( 408, rect.Height); +} + DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") { //Counting the Number of Frames and checking with the expected count |