[Libreoffice-commits] core.git: svgio/inc svgio/source
Chr. Rossmanith
ChrRossmanith at gmx.de
Fri Feb 6 01:18:18 PST 2015
svgio/inc/svgio/svgreader/svgstyleattributes.hxx | 3 +++
svgio/source/svgreader/svgstyleattributes.cxx | 17 +++++++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
New commits:
commit d0cfd49dc530574cbbc0a95c173de8936bc9c8ca
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date: Tue Feb 3 21:20:20 2015 +0100
tdf#87309: SVG - use black as default currentColor if no color was specified
improves import of attachment https://bugs.documentfoundation.org/attachment.cgi?id=110836 from issue 62284
Change-Id: Icb056774746ce270138a54e9dfe9ca6987a64769
Reviewed-on: https://gerrit.libreoffice.org/14242
Reviewed-by: Katarina Behrens <bubli at bubli.org>
Tested-by: Katarina Behrens <bubli at bubli.org>
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index 693772b..ac3fbf8 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -406,6 +406,9 @@ namespace svgio
const basegfx::BColor* getColor() const;
void setColor(const SvgPaint& rColor) { maColor = rColor; }
+ /// Resolve current color (defaults to black if no color is specified)
+ const basegfx::BColor* getCurrentColor() const;
+
/// Opacity content
SvgNumber getOpacity() const { return maOpacity; }
void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; }
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 182448f..fa71c63 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1888,19 +1888,28 @@ namespace svgio
return false;
}
+ const basegfx::BColor* SvgStyleAttributes::getCurrentColor() const
+ {
+ static basegfx::BColor aBlack(0.0, 0.0, 0.0);
+ const basegfx::BColor *aColor = getColor();
+ if( aColor )
+ return aColor;
+ else
+ return &aBlack;
+ }
+
const basegfx::BColor* SvgStyleAttributes::getFill() const
{
if(mbIsClipPathContent)
{
static basegfx::BColor aBlack(0.0, 0.0, 0.0);
-
return &aBlack;
}
else if(maFill.isSet())
{
if(maFill.isCurrent())
{
- return getColor();
+ return getCurrentColor();
}
else if(maFill.isOn())
{
@@ -1930,7 +1939,7 @@ namespace svgio
{
if(maStroke.isCurrent())
{
- return getColor();
+ return getCurrentColor();
}
else if(maStroke.isOn())
{
@@ -1954,7 +1963,7 @@ namespace svgio
{
if(maStopColor.isCurrent())
{
- return *getColor();
+ return *getCurrentColor();
}
else
{
More information about the Libreoffice-commits
mailing list