diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-08 17:19:10 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-09 08:36:39 +0200 |
commit | 41690703be4c15a95543a9d211ca272f7690e871 (patch) | |
tree | 849353bc5254640395eab4036f83dd31b17483f7 /sw | |
parent | f2517e82904b92989ed7e38a070c18234f460b33 (diff) |
sw_ooxmlimport: move export test to sw_ooxmlexport8
Change-Id: I56c157e9e8c5b5ea6eb64ea1eac6fed40e3b97cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102265
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76803.docx (renamed from sw/qa/extras/ooxmlimport/data/fdo76803.docx) | bin | 36516 -> 36516 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 35 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 34 |
3 files changed, 35 insertions, 34 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo76803.docx b/sw/qa/extras/ooxmlexport/data/fdo76803.docx Binary files differindex 65fad065a00b..65fad065a00b 100644 --- a/sw/qa/extras/ooxmlimport/data/fdo76803.docx +++ b/sw/qa/extras/ooxmlexport/data/fdo76803.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 74375341c60d..f95920b7a9dc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -53,6 +54,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <oox/drawingml/drawingmltypes.hxx> #include <xmloff/odffields.hxx> +#include <basegfx/polygon/b2dpolypolygontools.hxx> #include <IDocumentMarkAccess.hxx> #include <IMark.hxx> @@ -506,6 +508,39 @@ DECLARE_OOXMLEXPORT_TEST(testTDF91122, "tdf91122.docx") } } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76803, "fdo76803.docx") +{ + // The ContourPolyPolygon was wrong + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + + drawing::PointSequenceSequence rContour = getProperty<drawing::PointSequenceSequence>(xPropertySet, "ContourPolyPolygon"); + basegfx::B2DPolyPolygon aPolyPolygon(basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(rContour)); + + // We've got exactly one polygon inside + CPPUNIT_ASSERT_EQUAL(sal_uInt32(1), aPolyPolygon.count()); + + // Now check it deeply + basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(0)); + + CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aPolygon.count()); + + CPPUNIT_ASSERT_EQUAL(double(-149), aPolygon.getB2DPoint(0).getX()); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: -35 + // - Actual : -67 + // i.e. the cropping did not influence the wrap polygon during export. + CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(0).getY()); + + CPPUNIT_ASSERT_EQUAL(double(-149), aPolygon.getB2DPoint(1).getX()); + CPPUNIT_ASSERT_EQUAL(double(3511), aPolygon.getB2DPoint(1).getY()); + + CPPUNIT_ASSERT_EQUAL(double(16889), aPolygon.getB2DPoint(2).getX()); + CPPUNIT_ASSERT_EQUAL(double(3511), aPolygon.getB2DPoint(2).getY()); + + CPPUNIT_ASSERT_EQUAL(double(16889), aPolygon.getB2DPoint(3).getX()); + CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(3).getY()); +} + DECLARE_OOXMLEXPORT_TEST(testTDF91260, "tdf91260.docx") { uno::Reference<text::XTextRange> xFrame(getShape(1), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7079fd8bfd19..97011d4bf997 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -55,7 +55,6 @@ #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextTable.hpp> -#include <basegfx/polygon/b2dpolypolygontools.hxx> #include <o3tl/cppunittraitshelper.hxx> #include <unotools/fltrcfg.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -1158,39 +1157,6 @@ DECLARE_OOXMLIMPORT_TEST(testFdo75722dml, "fdo75722-dml.docx") CPPUNIT_ASSERT_EQUAL(sal_Int64(3128), nRot); } -DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo76803, "fdo76803.docx") -{ - // The ContourPolyPolygon was wrong - uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); - - drawing::PointSequenceSequence rContour = getProperty<drawing::PointSequenceSequence>(xPropertySet, "ContourPolyPolygon"); - basegfx::B2DPolyPolygon aPolyPolygon(basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(rContour)); - - // We've got exactly one polygon inside - CPPUNIT_ASSERT_EQUAL(sal_uInt32(1), aPolyPolygon.count()); - - // Now check it deeply - basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(0)); - - CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aPolygon.count()); - - CPPUNIT_ASSERT_EQUAL(double(-149), aPolygon.getB2DPoint(0).getX()); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: -35 - // - Actual : -67 - // i.e. the cropping did not influence the wrap polygon during export. - CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(0).getY()); - - CPPUNIT_ASSERT_EQUAL(double(-149), aPolygon.getB2DPoint(1).getX()); - CPPUNIT_ASSERT_EQUAL(double(3511), aPolygon.getB2DPoint(1).getY()); - - CPPUNIT_ASSERT_EQUAL(double(16889), aPolygon.getB2DPoint(2).getX()); - CPPUNIT_ASSERT_EQUAL(double(3511), aPolygon.getB2DPoint(2).getY()); - - CPPUNIT_ASSERT_EQUAL(double(16889), aPolygon.getB2DPoint(3).getX()); - CPPUNIT_ASSERT_EQUAL(double(-35), aPolygon.getB2DPoint(3).getY()); -} - DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.docx") { uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); |