Skip to content

Commit

Permalink
Constify
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 18, 2019
1 parent c17dc43 commit b3d5f27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -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 );

Expand All @@ -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() ) );

Expand Down

0 comments on commit b3d5f27

Please sign in to comment.