From 9c8c4415f64d91c0c30b025edef649344649c3d7 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 21 Aug 2017 15:54:47 -0400 Subject: tdf#60351 - add unit test for shape brought to foreground Test for this comment in d59ef5b2ddb9249905fecf941be6ec83251d12de // We should bring it to front, even if wp:anchor's behindDoc="1", // because otherwise paragraph background overlaps the graphic // TODO: if paragraph's background becomes bottommost, // then remove this hack Actually, the proper fix for this would be that the paragraph background also "wraps" around the picture (just like the text), not that the paragraph background becomes bottommost. The main concern in forcing to the foreground would be if wrap_THROUGH text would become hidden. However, testing suggests that cannot happen in this code. In that case, the worst would be that this shape now overlaps another shape - a rather unlikely situation. So this hack should be safe and maintained since it visually fixes a compatibility problem. Change-Id: I96495cd08a580afbca71a7f6d6dfd85652ff021b Reviewed-on: https://gerrit.libreoffice.org/41487 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 894c573a929f..1f93b06fa34f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1092,6 +1092,9 @@ 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 xPropertySet(getShape(1), uno::UNO_QUERY); + // test for TODO: if paragraph's background becomes bottommost [better yet: wraps around shape], then remove this hack + CPPUNIT_ASSERT_EQUAL_MESSAGE("HACK ALERT: Shape is in foreground", true, getProperty(xPropertySet, "Opaque")); + css::drawing::PointSequenceSequence aPolyPolygon; xPropertySet->getPropertyValue("ContourPolyPolygon") >>= aPolyPolygon; CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aPolyPolygon.getLength()); -- cgit