Skip to content

Commit

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

QDomElement paramElem = element.firstChildElement();
while ( !paramElem.isNull() )
{
if ( paramElem.localName() == QLatin1String( "SvgParameter" ) || paramElem.localName() == QLatin1String( "CssParameter" ) )
{
QString name = paramElem.attribute( QStringLiteral( "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() == QLatin1String("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 6ba303e

Please sign in to comment.