Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 30, 2013
1 parent d334b46 commit 9cc3c5c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/core/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,21 +952,26 @@ bool QgsCoordinateTransform::datumTransformCrsInfo( int datumTransform, int& eps
}

int srcCrsId, destCrsId;
if ( sqlite3_step( stmt ) == SQLITE_ROW )
if ( sqlite3_step( stmt ) != SQLITE_ROW )
{
epsgNr = sqlite3_column_int( stmt, 0 );
srcCrsId = sqlite3_column_int( stmt, 1 );
destCrsId = sqlite3_column_int( stmt, 2 );
sqlite3_finalize( stmt );
sqlite3_close( db );
return false;
}

epsgNr = sqlite3_column_int( stmt, 0 );
srcCrsId = sqlite3_column_int( stmt, 1 );
destCrsId = sqlite3_column_int( stmt, 2 );

QgsCoordinateReferenceSystem srcCrs;
srcCrs.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( srcCrsId ) );
srcProjection = srcCrs.description();
QgsCoordinateReferenceSystem destCrs;
destCrs.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( destCrsId ) );
dstProjection = destCrs.description();

sqlite3_finalize( stmt ); sqlite3_close( db );
sqlite3_finalize( stmt );
sqlite3_close( db );
return true;
}

Expand Down

0 comments on commit 9cc3c5c

Please sign in to comment.