[Libreoffice-commits] core.git: filter/source
Xisco Fauli
anistenis at gmail.com
Mon Dec 21 01:09:59 PST 2015
filter/source/svg/svgreader.cxx | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
New commits:
commit 3725144bfa547fcb76d54e3e2c0977ac09c436f0
Author: Xisco Fauli <anistenis at gmail.com>
Date: Sun Dec 13 20:32:42 2015 +0100
SVG: don't fill the gradient if there's no stop element present
Change-Id: Ia12bd6bdbc248b382a7cbee8b75bdff462e715bd
Reviewed-on: https://gerrit.libreoffice.org/20690
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index f824953..4cd7080 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -656,18 +656,24 @@ struct AnnotatingVisitor
{
if( rState.meFillType == GRADIENT )
{
- xAttrs->AddAttribute( "draw:fill", "gradient");
- xAttrs->AddAttribute( "draw:fill-gradient-name",
- getStyleName("svggradient", rState.maFillGradient.mnId) );
- if( hasGradientOpacity(rState.maFillGradient) )
+ // don't fill the gradient if there's no stop element present
+ if( rState.maFillGradient.maStops.size() == 0 )
+ xAttrs->AddAttribute( "draw:fill", "none" );
+ else
{
- // needs transparency gradient as well
- xAttrs->AddAttribute( "draw:opacity-name",
- getStyleName("svgopacity", rState.maFillGradient.mnId) );
+ xAttrs->AddAttribute( "draw:fill", "gradient");
+ xAttrs->AddAttribute( "draw:fill-gradient-name",
+ getStyleName("svggradient", rState.maFillGradient.mnId) );
+ if( hasGradientOpacity(rState.maFillGradient) )
+ {
+ // needs transparency gradient as well
+ xAttrs->AddAttribute( "draw:opacity-name",
+ getStyleName("svgopacity", rState.maFillGradient.mnId) );
+ }
+ else if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 )
+ xAttrs->AddAttribute( "draw:opacity",
+ OUString::number(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+"%" );
}
- else if( maCurrState.mnFillOpacity*maCurrState.mnOpacity != 1.0 )
- xAttrs->AddAttribute( "draw:opacity",
- OUString::number(100.0*maCurrState.mnFillOpacity*maCurrState.mnOpacity)+"%" );
}
else
{
More information about the Libreoffice-commits
mailing list