Skip to content

Commit

Permalink
Filter export for operators AND / OR
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 8, 2011
1 parent b72f086 commit 2e9a379
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions src/core/qgsexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgswfssourceselectbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2e9a379

Please sign in to comment.