Skip to content

Commit 0df7056

Browse files
author
jef
committed
fix projections selection when CRSes from multiple authorities are preselected
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13134 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f205b4d commit 0df7056

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/gui/qgsprojectionselector.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,18 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
251251
if ( authParts.isEmpty() )
252252
return sqlExpression;
253253

254-
foreach( QString auth_name, authParts.keys() )
254+
if( authParts.size() > 0 )
255255
{
256-
sqlExpression += QString( " AND (auth_name='%1' AND auth_id IN ('%2'))" )
257-
.arg( auth_name ).arg( authParts[auth_name].join( "','" ) );
256+
QString prefix = " AND (";
257+
foreach( QString auth_name, authParts.keys() )
258+
{
259+
sqlExpression += QString( "%1(auth_name='%2' AND auth_id IN ('%3'))" )
260+
.arg( prefix )
261+
.arg( auth_name )
262+
.arg( authParts[auth_name].join( "','" ) );
263+
prefix = " OR ";
264+
}
265+
sqlExpression += ")";
258266
}
259267

260268
QgsDebugMsg( "exiting with '" + sqlExpression + "'." );

0 commit comments

Comments
 (0)