Skip to content
Permalink
Browse files

moved node value parsing to ogc filter parsing

  • Loading branch information
luipir committed Feb 8, 2017
1 parent d722fb9 commit e05a8cafda23c49807d6c27f3aa4b9287bfc454a
Showing with 11 additions and 8 deletions.
  1. +11 −0 src/core/qgsogcutils.cpp
  2. +0 −8 src/core/symbology-ng/qgssymbollayerv2utils.cpp
@@ -19,6 +19,7 @@
#include "qgsgeometry.h"
#include "qgswkbptr.h"
#include "qgscoordinatereferencesystem.h"
#include "qgslogger.h"

#include <QColor>
#include <QStringList>
@@ -1584,6 +1585,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();
@@ -2592,14 +2592,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 e05a8ca

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