diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index f3aeb17022c2..243aa2cc07b3 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -348,29 +348,32 @@ struct AnnotatingVisitor } case XML_STOP: { - const sal_Int32 nNumAttrs( xAttributes->getLength() ); - maGradientStopVector.push_back(GradientStop()); - maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1); - - // first parse 'color' as 'stop-color' might depend on it - // if 'stop-color''s value is "currentColor" and parsed previously - uno::Reference xNodeColor(xAttributes->getNamedItem("color")); - if(xNodeColor.is()) - parseGradientStop( maGradientStopVector.back(), - maGradientStopVector.size()-1, - XML_STOP_COLOR, - xNodeColor->getNodeValue() ); - - //now, parse the rest of attributes - for( sal_Int32 i=0; iitem(i)->getNodeName())); - if ( nTokenId != XML_COLOR ) + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + maGradientStopVector.push_back(GradientStop()); + maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1); + + // first parse 'color' as 'stop-color' might depend on it + // if 'stop-color''s value is "currentColor" and parsed previously + uno::Reference xNodeColor(xAttributes->getNamedItem("color")); + if(xNodeColor.is()) parseGradientStop( maGradientStopVector.back(), - maGradientStopVector.size()-1, - nTokenId, - xAttributes->item(i)->getNodeValue() ); + maGradientStopVector.size()-1, + XML_STOP_COLOR, + xNodeColor->getNodeValue() ); + + //now, parse the rest of attributes + for( sal_Int32 i=0; iitem(i)->getNodeName())); + if ( nTokenId != XML_COLOR ) + parseGradientStop( maGradientStopVector.back(), + maGradientStopVector.size()-1, + nTokenId, + xAttributes->item(i)->getNodeValue() ); + } } break; }