diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-02-05 00:25:58 +0100 |
---|---|---|
committer | Xisco Faulí <anistenis@gmail.com> | 2016-02-11 17:17:06 +0000 |
commit | b6a62f07557fe4ae0931e0f3e0f306d2f69b116b (patch) | |
tree | 10539ba9812c0048bb23684c9502a424b67f2c0a /test/source | |
parent | 54e3ea8a86a309990f5edf78948bfe18dd2de96b (diff) |
tdf#97542: SVGIO: First check the current fill attribute
Differenciate when gradient is defined in the text element or in its parents
Add unit tests
Change-Id: I85b09f72fbb1a3c8d2fa7350b4396b5bf924277f
Reviewed-on: https://gerrit.libreoffice.org/22131
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Xisco Faulí <anistenis@gmail.com>
Diffstat (limited to 'test/source')
-rw-r--r-- | test/source/primitive2dxmldump.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index 84cef39aa822..dd1546fb6de0 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -24,6 +24,8 @@ #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx> #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> +#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx> +#include <drawinglayer/primitive2d/svggradientprimitive2d.hxx> #include <drawinglayer/attribute/lineattribute.hxx> @@ -180,8 +182,8 @@ void Primitive2dXmlDump::decomposeAndWrite( { rWriter.attribute("height", aScale.getY()); } - rWriter.attribute("text", pTextSimplePortionPrimitive2D->getText()); + rWriter.attribute("fontcolor", convertColorToString(pTextSimplePortionPrimitive2D->getFontColor())); rWriter.endElement(); } break; @@ -207,6 +209,30 @@ void Primitive2dXmlDump::decomposeAndWrite( } break; + case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D: + { + const ObjectInfoPrimitive2D* pObjectInfoPrimitive2D = dynamic_cast<const ObjectInfoPrimitive2D*>(pBasePrimitive); + rWriter.startElement("objectinfo"); + + decomposeAndWrite(pObjectInfoPrimitive2D->getChildren(), rWriter); + rWriter.endElement(); + } + break; + + case PRIMITIVE2D_ID_SVGRADIALGRADIENTPRIMITIVE2D: + { + const SvgRadialGradientPrimitive2D* pSvgRadialGradientPrimitive2D = dynamic_cast<const SvgRadialGradientPrimitive2D*>(pBasePrimitive); + rWriter.startElement("svgradialgradient"); + basegfx::B2DPoint aFocusAttribute = pSvgRadialGradientPrimitive2D->getFocal(); + + rWriter.attribute("radius", pSvgRadialGradientPrimitive2D->getRadius()); + rWriter.attribute("x", aFocusAttribute.getX()); + rWriter.attribute("y", aFocusAttribute.getY()); + + rWriter.endElement(); + } + break; + default: { rWriter.element(OUStringToOString(sCurrentElementTag, RTL_TEXTENCODING_UTF8)); |