mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-31 00:03:42 -04:00
SLD parsing: handling ogc:Literal within CssParameter
This commit is contained in:
parent
5abe66b4c7
commit
6ba303e3ad
@ -2566,6 +2566,7 @@ QDomElement QgsSymbolLayerUtils::createSvgParameterElement( QDomDocument &doc, c
|
||||
QgsStringMap QgsSymbolLayerUtils::getSvgParameterList( QDomElement &element )
|
||||
{
|
||||
QgsStringMap params;
|
||||
QString value;
|
||||
|
||||
QDomElement paramElem = element.firstChildElement();
|
||||
while ( !paramElem.isNull() )
|
||||
@ -2573,7 +2574,23 @@ QgsStringMap QgsSymbolLayerUtils::getSvgParameterList( QDomElement &element )
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user