Skip to content
Permalink
Browse files

Omit the layer title item completely if the string is empty

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9641 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 15, 2008
1 parent f67ac34 commit acf0f41cc7da26b4f28a1eefc2724a89ded50a11
Showing with 12 additions and 8 deletions.
  1. +12 −8 src/core/composer/qgscomposerlegend.cpp
@@ -97,14 +97,18 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
currentLayerItem = rootItem->child( i );
if ( currentLayerItem )
{
currentYCoordinate += mLayerSpace;
currentYCoordinate += fontAscentMillimeters( mLayerFont );

//draw layer Item
if ( painter )
{
drawText( painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont );
}
//Let the user omit the layer title item by having an empty layer title string
if(!currentLayerItem->text().isEmpty())
{
currentYCoordinate += mLayerSpace;
currentYCoordinate += fontAscentMillimeters( mLayerFont );

//draw layer Item
if ( painter )
{
drawText( painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont );
}
}

maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, currentLayerItem->text() ) );

0 comments on commit acf0f41

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