Skip to content

Commit 2e9a379

Browse files
committedDec 8, 2011
Filter export for operators AND / OR
1 parent b72f086 commit 2e9a379

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
 

‎src/core/qgsexpression.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,12 @@ bool QgsExpression::NodeBinaryOperator::toOGCFilter( QDomDocument& doc, QDomElem
10061006
case boGT:
10071007
opElem = doc.createElement( "PropertyIsGreaterThan" );
10081008
break;
1009+
case boOr:
1010+
opElem = doc.createElement( "Or" );
1011+
break;
1012+
case boAnd:
1013+
opElem = doc.createElement( "And" );
1014+
break;
10091015
default:
10101016
return false;
10111017
}
@@ -1040,3 +1046,20 @@ bool QgsExpression::NodeColumnRef::toOGCFilter( QDomDocument& doc, QDomElement&
10401046
parent.appendChild( propertyElem );
10411047
return true;
10421048
}
1049+
1050+
bool QgsExpression::NodeUnaryOperator::toOGCFilter( QDomDocument& doc, QDomElement& parent ) const
1051+
{
1052+
if ( mOp == uoNot )
1053+
{
1054+
QDomElement notElem = doc.createElement( "Not" );
1055+
if ( mOperand )
1056+
{
1057+
if ( mOperand->toOGCFilter( doc, notElem ) )
1058+
{
1059+
parent.appendChild( notElem );
1060+
return true;
1061+
}
1062+
}
1063+
}
1064+
return false;
1065+
}

‎src/core/qgsexpression.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ class CORE_EXPORT QgsExpression
255255
virtual QString dump() const;
256256
virtual QStringList referencedColumns() const { return mOperand->referencedColumns(); }
257257
virtual bool needsGeometry() const { return mOperand->needsGeometry(); }
258+
virtual bool toOGCFilter( QDomDocument& doc, QDomElement& parent ) const;
258259
protected:
259260
UnaryOperator mOp;
260261
Node* mOperand;

‎src/ui/qgswfssourceselectbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<item row="1" column="0">
107107
<widget class="QTreeWidget" name="treeWidget">
108108
<property name="selectionMode">
109-
<enum>QAbstractItemView::MultiSelection</enum>
109+
<enum>QAbstractItemView::ExtendedSelection</enum>
110110
</property>
111111
<property name="sortingEnabled">
112112
<bool>true</bool>

0 commit comments

Comments
 (0)
Please sign in to comment.