Skip to content
Permalink
Browse files
Filter export for operators AND / OR
  • Loading branch information
mhugent committed Dec 8, 2011
1 parent b72f086 commit 2e9a379541e5d238f8d91d8e5928e910dfc566ea
Showing with 25 additions and 1 deletion.
  1. +23 −0 src/core/qgsexpression.cpp
  2. +1 −0 src/core/qgsexpression.h
  3. +1 −1 src/ui/qgswfssourceselectbase.ui
@@ -1006,6 +1006,12 @@ bool QgsExpression::NodeBinaryOperator::toOGCFilter( QDomDocument& doc, QDomElem
case boGT:
opElem = doc.createElement( "PropertyIsGreaterThan" );
break;
case boOr:
opElem = doc.createElement( "Or" );
break;
case boAnd:
opElem = doc.createElement( "And" );
break;
default:
return false;
}
@@ -1040,3 +1046,20 @@ bool QgsExpression::NodeColumnRef::toOGCFilter( QDomDocument& doc, QDomElement&
parent.appendChild( propertyElem );
return true;
}

bool QgsExpression::NodeUnaryOperator::toOGCFilter( QDomDocument& doc, QDomElement& parent ) const
{
if ( mOp == uoNot )
{
QDomElement notElem = doc.createElement( "Not" );
if ( mOperand )
{
if ( mOperand->toOGCFilter( doc, notElem ) )
{
parent.appendChild( notElem );
return true;
}
}
}
return false;
}
@@ -255,6 +255,7 @@ class CORE_EXPORT QgsExpression
virtual QString dump() const;
virtual QStringList referencedColumns() const { return mOperand->referencedColumns(); }
virtual bool needsGeometry() const { return mOperand->needsGeometry(); }
virtual bool toOGCFilter( QDomDocument& doc, QDomElement& parent ) const;
protected:
UnaryOperator mOp;
Node* mOperand;
@@ -106,7 +106,7 @@
<item row="1" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>

0 comments on commit 2e9a379

Please sign in to comment.