Skip to content

Commit

Permalink
SLD parsing: handling ogc:Literal within CssParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrocha authored and rldhont committed Jan 23, 2017
1 parent 538b7c9 commit 6f09793
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Expand Up @@ -2655,14 +2655,31 @@ QDomElement QgsSymbolLayerV2Utils::createSvgParameterElement( QDomDocument &doc,
QgsStringMap QgsSymbolLayerV2Utils::getSvgParameterList( QDomElement &element )
{
QgsStringMap params;
QString value;

QDomElement paramElem = element.firstChildElement();
while ( !paramElem.isNull() )
{
if ( paramElem.localName() == "SvgParameter" || paramElem.localName() == "CssParameter" )
{
QString name = paramElem.attribute( "name" );
QString value = paramElem.firstChild().nodeValue();
if (paramElem.firstChild().nodeType() == QDomNode::TextNode)
{
value = paramElem.firstChild().nodeValue();
}
else
{
if (paramElem.firstChild().nodeType() == QDomNode::ElementNode &&
paramElem.firstChild().localName() == "Literal")
{
QgsDebugMsg(paramElem.firstChild().localName());
value = paramElem.firstChild().firstChild().nodeValue();
}
else
{
QgsDebugMsg(QString("unexpected child of %1").arg(paramElem.localName()));
}
}

if ( !name.isEmpty() && !value.isEmpty() )
params[ name ] = value;
Expand Down

0 comments on commit 6f09793

Please sign in to comment.