Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use unique_ptr
  • Loading branch information
mhugent committed Jun 24, 2017
1 parent e0efbda commit 77b9b1a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -716,14 +716,10 @@ namespace QgsWms
}

//read FILTER_GEOM
QgsGeometry* filterGeom = 0;
std::unique_ptr<QgsGeometry> filterGeom;
if( mParameters.contains( QStringLiteral( "FILTER_GEOM" ) ) )
{
filterGeom = new QgsGeometry( QgsGeometry::fromWkt( mParameters.value( QStringLiteral( "FILTER_GEOM" ) ) ) );
if( filterGeom->isNull() )
{
delete filterGeom; filterGeom = nullptr;
}
filterGeom.reset( new QgsGeometry( QgsGeometry::fromWkt( mParameters.value( QStringLiteral( "FILTER_GEOM" ) ) ) ) );
}

//In case the output image is distorted (WIDTH/HEIGHT ratio not equal to BBOX width/height), I and J need to be adapted as well
Expand All @@ -747,7 +743,7 @@ namespace QgsWms
{
featuresRect.reset( new QgsRectangle() );
}
else if( !filterGeom )
else if( !filterGeom.get() )
{
throw QgsBadRequestException( QStringLiteral( "ParameterMissing" ),
QStringLiteral( "I/J parameters are required for GetFeatureInfo" ) );
Expand Down Expand Up @@ -882,7 +878,7 @@ namespace QgsWms

if ( vectorLayer )
{
if ( !featureInfoFromVectorLayer( vectorLayer, infoPoint.get(), featureCount, result, layerElement, mapSettings, renderContext, version, infoFormat, featuresRect.get(), filterGeom ) )
if ( !featureInfoFromVectorLayer( vectorLayer, infoPoint.get(), featureCount, result, layerElement, mapSettings, renderContext, version, infoFormat, featuresRect.get(), filterGeom.get() ) )
{
continue;
}
Expand Down

0 comments on commit 77b9b1a

Please sign in to comment.