[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 06:37:24 UTC 2020


 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |   35 ++++++++++++++++++++++++++++++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   34 -----------------------------
 2 files changed, 35 insertions(+), 34 deletions(-)

New commits:
commit 41690703be4c15a95543a9d211ca272f7690e871
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Sep 8 17:19:10 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Sep 9 08:36:39 2020 +0200

    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 at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlimport/data/fdo76803.docx b/sw/qa/extras/ooxmlexport/data/fdo76803.docx
similarity index 100%
rename from sw/qa/extras/ooxmlimport/data/fdo76803.docx
rename to 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);


More information about the Libreoffice-commits mailing list