Skip to content
Permalink
Browse files

fix #6978

  • Loading branch information
jef-n committed Jul 15, 2013
1 parent d0c3f4f commit 33cbb6c0642ce699d15304480d9f1788b343a7e3
Showing with 8 additions and 4 deletions.
  1. +5 −2 src/mapserver/qgis_map_serv.cpp
  2. +3 −2 src/mapserver/qgswmsserver.cpp
@@ -602,7 +602,9 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.compare( "GetLegendGraphic", Qt::CaseInsensitive ) == 0 || request.compare( "GetLegendGraphics", Qt::CaseInsensitive ) == 0 ) // GetLegendGraphics for compatibility with earlier QGIS versions
else if ( request.compare( "GetLegendGraphic", Qt::CaseInsensitive ) == 0 ||
request.compare( "GetLegendGraphics", Qt::CaseInsensitive ) == 0 )
// GetLegendGraphics for compatibility with earlier QGIS versions
{
QImage* result = 0;
try
@@ -611,6 +613,7 @@ int main( int argc, char * argv[] )
}
catch ( QgsMapServiceException& ex )
{
QgsDebugMsg( "Caught exception during GetLegendGraphic request" );
theRequestHandler->sendServiceException( ex );
}

@@ -619,6 +622,7 @@ int main( int argc, char * argv[] )
QgsDebugMsg( "Sending GetLegendGraphic response" );
//sending is the same for GetMap and GetLegendGraphic
theRequestHandler->sendGetMapResponse( serviceString, result );
QgsDebugMsg( "Response sent" );
}
else
{
@@ -629,7 +633,6 @@ int main( int argc, char * argv[] )
delete theRequestHandler;
delete theServer;
continue;

}
else if ( request.compare( "GetPrint", Qt::CaseInsensitive ) == 0 )
{
@@ -380,17 +380,18 @@ QImage* QgsWMSServer::getLegendGraphics()
boxSpace, layerSpace, layerTitleSpace, symbolSpace, iconLabelSpace, symbolWidth, symbolHeight, fontOversamplingFactor,
theImage->dotsPerMeterX() * 0.0254 );
}
currentY += layerSpace;
}
currentY += boxSpace;

//create second image with the right dimensions
QImage* paintImage = createImage( maxTextWidth + maxSymbolWidth, currentY );
QImage* paintImage = createImage( maxTextWidth + maxSymbolWidth, ceil( currentY ) );

//go through the items a second time for painting
QPainter p( paintImage );
p.setRenderHint( QPainter::Antialiasing, true );
currentY = boxSpace;

currentY = boxSpace;
for ( int i = 0; i < numLayerItems; ++i )
{
QgsComposerLayerItem* layerItem = dynamic_cast<QgsComposerLayerItem*>( rootItem->child( i ) );

0 comments on commit 33cbb6c

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