Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WFS EXP_FILTER respect complex expressions
  • Loading branch information
elpaso committed Jan 21, 2019
1 parent d4ac931 commit ad7ab51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions src/server/services/wfs/qgswfsparameters.cpp
Expand Up @@ -76,18 +76,23 @@ namespace QgsWfs
if ( val.isEmpty() )
return theList;

QRegExp rx( exp );
if ( rx.indexIn( val, 0 ) == -1 )
{
if ( exp.isEmpty() )
theList << val;
}
else
{
int pos = 0;
while ( ( pos = rx.indexIn( val, pos ) ) != -1 )
QRegExp rx( exp );
if ( rx.indexIn( val, 0 ) == -1 )
{
theList << val;
}
else
{
theList << rx.cap( 1 );
pos += rx.matchedLength();
int pos = 0;
while ( ( pos = rx.indexIn( val, pos ) ) != -1 )
{
theList << rx.cap( 1 );
pos += rx.matchedLength();
}
}
}

Expand Down Expand Up @@ -332,7 +337,7 @@ namespace QgsWfs

QStringList QgsWfsParameters::expFilters() const
{
return mWfsParameters[ QgsWfsParameter::EXP_FILTER ].toStringListWithExp();
return mWfsParameters[ QgsWfsParameter::EXP_FILTER ].toStringListWithExp( QString( ) );
}

QString QgsWfsParameters::geometryNameAsString() const
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wfs/qgswfsparameters.h
Expand Up @@ -83,7 +83,7 @@ namespace QgsWfs

/**
* Converts the parameter into a list of string.
* \param exp The expression to use for splitting
* \param exp The expression to use for splitting, pass an empty string to avoid splitting
* \returns A list of strings
* \throws QgsBadRequestException Invalid parameter exception
*/
Expand Down

0 comments on commit ad7ab51

Please sign in to comment.