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@9641 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 15, 2008
1 parent 4f093a7 commit 6a7ada7e029136ddec2b38bc8f704468a5a07f91
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 6a7ada7

Please sign in to comment.