diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-05-13 17:59:34 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-05-13 21:29:25 +0200 |
commit | 2abe9837deee3823c7928a76b5b2f94f1464f1a3 (patch) | |
tree | 6aba4ef8158d9b0f555581d2628bea4ea2818eb1 /sw | |
parent | cbc9c1ef729a09abdda97f74469d4d600ae6974b (diff) |
DOCX import: fix interaction between the crop and the wrap polygon of images
Word first applies the crop, then applies the wrap polygon on the
remaining visible part of the image.
Writer applies the crop on the original bitmap, and even has explicit
code to make sure the uncropped bitmap is used for the wrap polygon, see
how SwFlyFrame::GetContour() calls SwNoTextFrame::GetGrfArea(), which
will extend the resulting size based on cropping.
Fix the problem by moving and scaling the wrap polygon, so it ends up
where it would in Word.
Also adapt testFdo76803, which had a similar crop+wrap polygon case, but
the different there is quite small.
Change-Id: Iab2adaa81a33eb04e1806b17ed129ac50f5d2aa3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94149
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 14d0d2797f8b..48de70ea00b6 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -981,17 +981,17 @@ DECLARE_OOXMLIMPORT_TEST(testFdo76803, "fdo76803.docx") CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aPolygon.count()); - CPPUNIT_ASSERT_EQUAL(double(-163), aPolygon.getB2DPoint(0).getX()); - CPPUNIT_ASSERT_EQUAL(double(0), aPolygon.getB2DPoint(0).getY()); + CPPUNIT_ASSERT_EQUAL(double(-162), aPolygon.getB2DPoint(0).getX()); + CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(0).getY()); - CPPUNIT_ASSERT_EQUAL(double(-163), aPolygon.getB2DPoint(1).getX()); - CPPUNIT_ASSERT_EQUAL(double(3661), aPolygon.getB2DPoint(1).getY()); + CPPUNIT_ASSERT_EQUAL(double(-162), aPolygon.getB2DPoint(1).getX()); + CPPUNIT_ASSERT_EQUAL(double(3510), aPolygon.getB2DPoint(1).getY()); - CPPUNIT_ASSERT_EQUAL(double(16987), aPolygon.getB2DPoint(2).getX()); - CPPUNIT_ASSERT_EQUAL(double(3661), aPolygon.getB2DPoint(2).getY()); + CPPUNIT_ASSERT_EQUAL(double(16892), aPolygon.getB2DPoint(2).getX()); + CPPUNIT_ASSERT_EQUAL(double(3510), aPolygon.getB2DPoint(2).getY()); - CPPUNIT_ASSERT_EQUAL(double(16987), aPolygon.getB2DPoint(3).getX()); - CPPUNIT_ASSERT_EQUAL(double(0), aPolygon.getB2DPoint(3).getY()); + CPPUNIT_ASSERT_EQUAL(double(16892), aPolygon.getB2DPoint(3).getX()); + CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(3).getY()); } DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.docx") |