Skip to content
Permalink
Browse files

moved node value parsing to ogc filter parsing

  • Loading branch information
luipir committed Feb 8, 2017
1 parent 04e391f commit e4d3da2eca0d8bae947b448379f31c86ded80e13
Showing with 10 additions and 8 deletions.
  1. +10 −0 src/core/qgsogcutils.cpp
  2. +0 −8 src/core/symbology-ng/qgssymbollayerv2utils.cpp
@@ -1599,6 +1599,16 @@ QgsExpression* QgsOgcUtils::expressionFromOgcFilter( const QDomElement& element
if ( element.isNull() || !element.hasChildNodes() )
return nullptr;

// check if it is a single string value => no DomElement
if ( element.firstChild().nodeType() == QDomNode::TextNode )
{
QgsExpression *expr = new QgsExpression( element.firstChild().nodeValue() );
expr->d->mParserErrorString = QString();
return expr;
}

// now parse OGC operators. OGC operator does not have a only text value
// but only sub element operators
QgsExpression *expr = new QgsExpression();

QDomElement childElem = element.firstChildElement();
@@ -2593,14 +2593,6 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
return false;
}

// check if it is a single string value
if ( elem.hasChildNodes() &&
elem.firstChild().nodeType() == QDomNode::TextNode )
{
function = elem.firstChild().nodeValue();
return true;
}

// parse ogc:Filter
QgsExpression *expr = QgsOgcUtils::expressionFromOgcFilter( elem );
if ( !expr )

0 comments on commit e4d3da2

Please sign in to comment.
You can’t perform that action at this time.