diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2015-02-03 21:20:20 +0100 |
---|---|---|
committer | Katarina Behrens <bubli@bubli.org> | 2015-02-06 09:17:49 +0000 |
commit | d0cfd49dc530574cbbc0a95c173de8936bc9c8ca (patch) | |
tree | 21985d6fea161338077dae76bcbec093a7c4a974 /svgio/source | |
parent | 641835ec3234da3744a4ea3c15ff3c4e3aef1528 (diff) |
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@bubli.org>
Tested-by: Katarina Behrens <bubli@bubli.org>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgstyleattributes.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 182448f827e5..fa71c63213cc 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 { |