Skip to content

Commit

Permalink
server: accept empty bbox as valid (followup 57046c5, fixes #12440)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 24, 2015
1 parent 7469d2b commit 6309dbd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/server/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,8 @@ static QgsRectangle _parseBBOX( const QString &bboxStr, bool &ok )
return QgsRectangle();
}

QgsRectangle bbox( d[0], d[1], d[2], d[3] );
if ( bbox.isEmpty() )
return QgsRectangle();

ok = true;
return bbox;
return QgsRectangle( d[0], d[1], d[2], d[3] );
}


Expand Down Expand Up @@ -646,7 +642,7 @@ QImage* QgsWMSServer::getLegendGraphics()

bool bboxOk;
contentBasedLegendExtent = _parseBBOX( mParameters["BBOX"], bboxOk );
if ( !bboxOk )
if ( !bboxOk || contentBasedLegendExtent.isEmpty() )
throw QgsMapServiceException( "InvalidParameterValue", "Invalid BBOX parameter" );

if ( mParameters.contains( "RULE" ) )
Expand Down Expand Up @@ -1772,7 +1768,7 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
mMapRenderer->setOutputSize( QSize( paintDevice->width(), paintDevice->height() ), paintDevice->logicalDpiX() );

//map extent
bool bboxOk = true;
bool bboxOk;
QgsRectangle mapExtent = _parseBBOX( mParameters.value( "BBOX", "0,0,0,0" ), bboxOk );
if ( !bboxOk )
{
Expand Down

0 comments on commit 6309dbd

Please sign in to comment.