[Libreoffice-commits] core.git: svgio/qa test/source
Xisco Fauli
anistenis at gmail.com
Sun Mar 6 15:16:43 UTC 2016
svgio/qa/cppunit/SvgImportTest.cxx | 25 +++++++++++++++++++++++++
test/source/primitive2dxmldump.cxx | 4 ++++
2 files changed, 29 insertions(+)
New commits:
commit 5f0c3172b3d2a5d3a71ab19caa5b462b539cbbe6
Author: Xisco Fauli <anistenis at gmail.com>
Date: Sun Mar 6 14:11:04 2016 +0100
SVGIO: Check minX, minY, maxX and maxY in polypolygon
Change-Id: I768bef34ad0ba7708134e73981dabf0d47c2f259
Reviewed-on: https://gerrit.libreoffice.org/22952
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Xisco FaulĂ <anistenis at gmail.com>
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 3ac20dd..3b0c772 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -118,9 +118,14 @@ void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00cc00"); // rect background color
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100"); // rect background height
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100"); // rect background width
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "minx", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "miny", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxx", "110");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxy", "110");
assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "color", "#ff0000"); // rect stroke color
assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "3"); // rect stroke width
+
}
@@ -178,6 +183,10 @@ void Test::testTdf87309()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#000000");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "minx", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "miny", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxx", "110");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxy", "110");
}
void Test::testFontsizeKeywords()
@@ -330,6 +339,10 @@ void Test::testTdf97543()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00cc00");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "minx", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "miny", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxx", "110");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxy", "110");
}
void Test::testRGBColor()
@@ -345,6 +358,10 @@ void Test::testRGBColor()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#646464");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "minx", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "miny", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxx", "110");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxy", "110");
}
void Test::testRGBAColor()
@@ -374,9 +391,17 @@ void Test::testTdf97936()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "height", "50");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "width", "50");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "minx", "70");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "miny", "50");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "maxx", "120");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "maxy", "100");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "height", "50");
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "width", "50");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "minx", "10");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "miny", "50");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "maxx", "60");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "maxy", "100");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx
index fbd0b99..0f7a4fc 100644
--- a/test/source/primitive2dxmldump.cxx
+++ b/test/source/primitive2dxmldump.cxx
@@ -128,6 +128,10 @@ void Primitive2dXmlDump::decomposeAndWrite(
const basegfx::B2DRange aB2DRange(aB2DPolyPolygon.getB2DRange());
rWriter.attribute("height", aB2DRange.getHeight());
rWriter.attribute("width", aB2DRange.getWidth());
+ rWriter.attribute("minx", aB2DRange.getMinX());
+ rWriter.attribute("miny", aB2DRange.getMinY());
+ rWriter.attribute("maxx", aB2DRange.getMaxX());
+ rWriter.attribute("maxy", aB2DRange.getMaxY());
rWriter.startElement("polypolygon");
rWriter.content(basegfx::tools::exportToSvgD(rPolyPolygonColorPrimitive2D.getB2DPolyPolygon(), true, true, false));
rWriter.endElement();
More information about the Libreoffice-commits
mailing list