Skip to content
Permalink
Browse files

Constify

  • Loading branch information
nyalldawson committed Jan 18, 2019
1 parent c17dc43 commit b3d5f277d97372efc14eabd1808a0d9f2ccf686c
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/layertree/qgslayertreemodellegendnode.cpp
@@ -92,7 +92,7 @@ QSizeF QgsLayerTreeModelLegendNode::drawSymbolText( const QgsLegendSettings &set
double textHeight = settings.fontHeightCharacterMM( symbolLabelFont, QChar( '0' ) );
double textDescent = settings.fontDescentMillimeters( symbolLabelFont );

QStringList lines = settings.splitStringForWrapping( data( Qt::DisplayRole ).toString() );
const QStringList lines = settings.splitStringForWrapping( data( Qt::DisplayRole ).toString() );

labelSize.rheight() = lines.count() * textHeight + ( lines.count() - 1 ) * ( settings.lineSpacing() + textDescent );

@@ -111,7 +111,7 @@ QSizeF QgsLayerTreeModelLegendNode::drawSymbolText( const QgsLegendSettings &set
labelY += textHeight;
}

for ( QStringList::Iterator itemPart = lines.begin(); itemPart != lines.end(); ++itemPart )
for ( QStringList::ConstIterator itemPart = lines.constBegin(); itemPart != lines.constEnd(); ++itemPart )
{
labelSize.rwidth() = std::max( settings.textWidthMillimeters( symbolLabelFont, *itemPart ), double( labelSize.width() ) );

0 comments on commit b3d5f27

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