Skip to content

Commit b8f352f

Browse files
jgrocharldhont
authored andcommitted
SLD parsing: handling ogc:Literal within CssParameter
1 parent e23a3d0 commit b8f352f

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,14 +2656,31 @@ QDomElement QgsSymbolLayerV2Utils::createSvgParameterElement( QDomDocument &doc,
26562656
QgsStringMap QgsSymbolLayerV2Utils::getSvgParameterList( QDomElement &element )
26572657
{
26582658
QgsStringMap params;
2659+
QString value;
26592660

26602661
QDomElement paramElem = element.firstChildElement();
26612662
while ( !paramElem.isNull() )
26622663
{
26632664
if ( paramElem.localName() == "SvgParameter" || paramElem.localName() == "CssParameter" )
26642665
{
26652666
QString name = paramElem.attribute( "name" );
2666-
QString value = paramElem.firstChild().nodeValue();
2667+
if (paramElem.firstChild().nodeType() == QDomNode::TextNode)
2668+
{
2669+
value = paramElem.firstChild().nodeValue();
2670+
}
2671+
else
2672+
{
2673+
if (paramElem.firstChild().nodeType() == QDomNode::ElementNode &&
2674+
paramElem.firstChild().localName() == "Literal")
2675+
{
2676+
QgsDebugMsg(paramElem.firstChild().localName());
2677+
value = paramElem.firstChild().firstChild().nodeValue();
2678+
}
2679+
else
2680+
{
2681+
QgsDebugMsg(QString("unexpected child of %1").arg(paramElem.localName()));
2682+
}
2683+
}
26672684

26682685
if ( !name.isEmpty() && !value.isEmpty() )
26692686
params[ name ] = value;

0 commit comments

Comments
 (0)