Skip to content

Commit

Permalink
moved node value parsing to ogc filter parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Feb 8, 2017
1 parent 04e391f commit e4d3da2
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 @@ -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();
Expand Down
8 changes: 0 additions & 8 deletions src/core/symbology-ng/qgssymbollayerv2utils.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit e4d3da2

Please sign in to comment.