[Libreoffice-commits] core.git: svgio/qa test/source
Xisco Fauli
anistenis at gmail.com
Thu Mar 3 23:35:33 UTC 2016
svgio/qa/cppunit/SvgImportTest.cxx | 12 ++++++++++++
test/source/primitive2dxmldump.cxx | 5 ++++-
2 files changed, 16 insertions(+), 1 deletion(-)
New commits:
commit 31e037c348ef0e04393926891617fde1b0051a35
Author: Xisco Fauli <anistenis at gmail.com>
Date: Thu Mar 3 23:19:01 2016 +0100
SVGIO: Check height and width of polypolygoncolor
Change-Id: Ibc5844d4e4a89fae7bbc8d2b854384d0c433500f
Reviewed-on: https://gerrit.libreoffice.org/22883
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 365fb01..3ac20dd 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -116,6 +116,8 @@ void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
CPPUNIT_ASSERT (pDocument);
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/polypolygonstroke/line", "color", "#ff0000"); // rect stroke color
assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "3"); // rect stroke width
@@ -174,6 +176,8 @@ void Test::testTdf87309()
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#000000");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
}
void Test::testFontsizeKeywords()
@@ -324,6 +328,8 @@ void Test::testTdf97543()
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00cc00");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
}
void Test::testRGBColor()
@@ -337,6 +343,8 @@ void Test::testRGBColor()
CPPUNIT_ASSERT (pDocument);
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#646464");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100");
}
void Test::testRGBAColor()
@@ -364,7 +372,11 @@ void Test::testTdf97936()
CPPUNIT_ASSERT (pDocument);
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[2]");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "height", "50");
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "width", "50");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx
index d1b2fcb..fbd0b99 100644
--- a/test/source/primitive2dxmldump.cxx
+++ b/test/source/primitive2dxmldump.cxx
@@ -113,7 +113,6 @@ void Primitive2dXmlDump::decomposeAndWrite(
{
const TransformPrimitive2D& rTransformPrimitive2D = dynamic_cast<const TransformPrimitive2D&>(*pBasePrimitive);
rWriter.startElement("transform");
- //pTransformPrimitive2D->getTransformation()
decomposeAndWrite(rTransformPrimitive2D.getChildren(), rWriter);
rWriter.endElement();
}
@@ -125,6 +124,10 @@ void Primitive2dXmlDump::decomposeAndWrite(
rWriter.startElement("polypolygoncolor");
rWriter.attribute("color", convertColorToString(rPolyPolygonColorPrimitive2D.getBColor()));
+ const basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPolygonColorPrimitive2D.getB2DPolyPolygon());
+ const basegfx::B2DRange aB2DRange(aB2DPolyPolygon.getB2DRange());
+ rWriter.attribute("height", aB2DRange.getHeight());
+ rWriter.attribute("width", aB2DRange.getWidth());
rWriter.startElement("polypolygon");
rWriter.content(basegfx::tools::exportToSvgD(rPolyPolygonColorPrimitive2D.getB2DPolyPolygon(), true, true, false));
rWriter.endElement();
More information about the Libreoffice-commits
mailing list