Skip to content

Commit 0c4e8e6

Browse files
committedOct 19, 2014
Minor code cleanups for composer attribute table widget
1 parent 7773d4e commit 0c4e8e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/app/composer/qgscomposerattributetablewidget.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,17 @@ void QgsComposerAttributeTableWidget::updateRelationsCombo()
565565
QgsVectorLayer* atlasLayer = atlasCoverageLayer();
566566
if ( atlasLayer )
567567
{
568-
QList<QgsRelation> relations = QgsProject::instance()->relationManager()->referencedRelations( mComposerTable->composition()->atlasComposition().coverageLayer() );
568+
QList<QgsRelation> relations = QgsProject::instance()->relationManager()->referencedRelations( atlasLayer );
569569
Q_FOREACH ( const QgsRelation& relation, relations )
570570
{
571571
mRelationsComboBox->addItem( relation.name(), relation.id() );
572572
}
573+
if ( mComposerTable )
574+
{
575+
mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mComposerTable->relationId() ) );
576+
}
573577
}
574578

575-
mRelationsComboBox->setCurrentIndex( mRelationsComboBox->findData( mComposerTable->relationId() ) );
576579
mRelationsComboBox->blockSignals( false );
577580
}
578581

0 commit comments

Comments
 (0)
Please sign in to comment.