summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-11-21 16:18:38 +1000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-23 11:32:08 +0000
commitd59ef5b2ddb9249905fecf941be6ec83251d12de (patch)
treefc03b5080f7795fad15a79fac66d2dfc9171a7f5 /sw
parent0cda1453a0e24e9ad6884a1345e4514a86900346 (diff)
tdf#60351: Use Wrap Polygon also for PROP_SIZE_PIXEL
Since commit 2b5bf2f1c57d6585ec898c4c44a74c5b47f09ab9 "graphic import improved" from 2006-11-20 by Oliver Specht, there is an unused code reading pixel size (PROP_SIZE_PIXEL) of an image in a part of GraphicImport::createGraphicObject() that imports the wrap polygon. When there's no PROP_SIZE100th_M_M in graphic, the imported wrap polygon was simply dropped, and then automatic contour was generated for graphic. Now we import contour correctly in this case. Also, as paragraph background overlaps non-opaque graphics, we need to set opaque to true regardless of behindDoc value of wp:anchor. Change-Id: Ifa5eec9f8ccaf5ba051732b6e4f965ae8606a1cf Reviewed-on: https://gerrit.libreoffice.org/20103 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf60351.docxbin0 -> 26060 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf60351.docx b/sw/qa/extras/ooxmlimport/data/tdf60351.docx
new file mode 100644
index 000000000000..b61294dfdaa3
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf60351.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8a11157ef8ed..4eb7007d9958 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2931,6 +2931,30 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95775, "tdf95775.docx")
// This must not fail in layout
}
+DECLARE_OOXMLIMPORT_TEST(testTdf60351, "tdf60351.docx")
+{
+ // Get the first image in the document and check its contour polygon.
+ // It should contain 6 points. Check their coordinates.
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY);
+ css::drawing::PointSequenceSequence aPolyPolygon;
+ xPropertySet->getPropertyValue("ContourPolyPolygon") >>= aPolyPolygon;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aPolyPolygon.getLength());
+ const css::drawing::PointSequence& aPolygon = aPolyPolygon[0];
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aPolygon.getLength());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[0].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[0].Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(316), aPolygon[1].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[1].Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(316), aPolygon[2].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(316), aPolygon[2].Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(158), aPolygon[3].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(298), aPolygon[3].Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[4].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(316), aPolygon[4].Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aPolygon[5].Y);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */