Skip to content
Permalink
Browse files

Use unique_ptr

  • Loading branch information
mhugent committed Jun 24, 2017
1 parent e0efbda commit 77b9b1a7064c25d0fa9ce795f13b1a5724654e92
Showing with 4 additions and 8 deletions.
  1. +4 −8 src/server/services/wms/qgswmsrenderer.cpp
@@ -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
@@ -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" ) );
@@ -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;
}

0 comments on commit 77b9b1a

Please sign in to comment.
You can’t perform that action at this time.