Skip to content

Commit

Permalink
Fix #7012
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Aug 12, 2013
1 parent 9c4c215 commit df0d690
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/core/composer/qgscomposerlegend.cpp
Expand Up @@ -326,11 +326,6 @@ QgsComposerLegend::Nucleon QgsComposerLegend::drawSymbolItem( QgsComposerLegendI
#endif

QString text = symbolItem->text();
if ( text.isEmpty() )
{
// Use layer label, used for single symbols
text = layerItem->text();
}

QStringList lines = splitStringForWrapping( text );

Expand Down
6 changes: 6 additions & 0 deletions src/core/composer/qgslegendmodel.cpp
Expand Up @@ -170,6 +170,7 @@ int QgsLegendModel::addVectorLayerItemsV2( QStandardItem* layerItem, QgsVectorLa
if ( oldSymbolItem )
{
currentSymbolItem->setUserText( oldSymbolItem->userText() );

}

currentSymbolItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
Expand Down Expand Up @@ -272,6 +273,11 @@ void QgsLegendModel::updateSymbolV2ItemText( QStandardItem* symbolItem )

QString label = sv2Item->userText().isEmpty() ? symbol.first : sv2Item->userText();

if ( renderer->type() == "singleSymbol" )
{
label = vLayer->name();
}

if ( lItem->showFeatureCount() )
{
// Add counts to multi symbols layers only or labeled single symbols,
Expand Down

1 comment on commit df0d690

@NathanW2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closed #8446. Mistake in commit name.

Please sign in to comment.