Skip to content

Commit

Permalink
Moved check single value in expressionFromOgcFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Feb 8, 2017
1 parent 64d1848 commit 2dfb6dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/core/qgsogcutils.cpp
Expand Up @@ -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() )
{
Expand Down
8 changes: 0 additions & 8 deletions src/core/symbology-ng/qgssymbollayerutils.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 2dfb6dc

Please sign in to comment.