Moved check single value in expressionFromOgcFilter

This commit is contained in:
Luigi Pirelli 2017-02-08 12:09:57 +01:00
parent 64d18482c8
commit 2dfb6dcc5d
2 changed files with 10 additions and 8 deletions

View File

@ -1603,6 +1603,16 @@ QgsExpression* QgsOgcUtils::expressionFromOgcFilter( const QDomElement& element
QgsExpression *expr = new QgsExpression();
// check if it is a single string value not having DOM elements
// that express OGC operators
if ( element.firstChild().nodeType() == QDomNode::TextNode )
{
expr->setExpression( element.firstChild().nodeValue() );
return expr;
}
// then check OGC DOM elements that contain OGC tags specifying
// OGC operators.
QDomElement childElem = element.firstChildElement();
while ( !childElem.isNull() )
{

View File

@ -2515,14 +2515,6 @@ bool QgsSymbolLayerUtils::functionFromSldElement( QDomElement &element, QString
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 )