Skip to content

Commit

Permalink
Follow up 21c81d6
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 17, 2014
1 parent 2b2066a commit 307d4bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -3523,12 +3523,12 @@ void QgsComposer::writeWorldFile( QString worldFileName, double a, double b, dou
}


void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature * feat )
void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature& feat )
{
//update expression variables
QgsExpression::setSpecialColumn( "$atlasfeatureid", feat->id() );
QgsExpression::setSpecialColumn( "$atlasfeature", QVariant::fromValue( *feat ) );
QgsExpression::setSpecialColumn( "$atlasgeometry", QVariant::fromValue( *( feat->geometry() ) ) );
QgsExpression::setSpecialColumn( "$atlasfeatureid", feat.id() );
QgsExpression::setSpecialColumn( "$atlasfeature", QVariant::fromValue( feat ) );
QgsExpression::setSpecialColumn( "$atlasgeometry", QVariant::fromValue( *( feat.geometry() ) ) );

emit atlasPreviewFeatureChanged();

Expand Down Expand Up @@ -3557,7 +3557,7 @@ void QgsComposer::setAtlasFeature( QgsMapLayer* layer, const QgsFeature * feat )
activate();

//set current preview feature id
atlas.prepareForFeature( feat );
atlas.prepareForFeature( &feat );
emit( atlasPreviewFeatureChanged() );
}

Expand All @@ -3573,7 +3573,7 @@ void QgsComposer::updateAtlasMapLayerAction( QgsVectorLayer *coverageLayer )
{
mAtlasFeatureAction = new QgsMapLayerAction( QString( tr( "Set as atlas feature for %1" ) ).arg( mTitle ), this, coverageLayer, QgsMapLayerAction::SingleFeature );
QgsMapLayerActionRegistry::instance()->addMapLayerAction( mAtlasFeatureAction );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature* ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature* ) ) );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature& ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature& ) ) );
}
}

Expand Down Expand Up @@ -3618,7 +3618,7 @@ void QgsComposer::updateAtlasMapLayerAction( bool atlasEnabled )
QgsAtlasComposition& atlas = mComposition->atlasComposition();
mAtlasFeatureAction = new QgsMapLayerAction( QString( tr( "Set as atlas feature for %1" ) ).arg( mTitle ), this, atlas.coverageLayer(), QgsMapLayerAction::SingleFeature );
QgsMapLayerActionRegistry::instance()->addMapLayerAction( mAtlasFeatureAction );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature* ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature* ) ) );
connect( mAtlasFeatureAction, SIGNAL( triggeredForFeature( QgsMapLayer*, const QgsFeature& ) ), this, SLOT( setAtlasFeature( QgsMapLayer*, const QgsFeature& ) ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.h
Expand Up @@ -620,7 +620,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

//! Sets the specified feature as the current atlas feature
//! @note added in 2.1
void setAtlasFeature( QgsMapLayer* layer, const QgsFeature *feat );
void setAtlasFeature( QgsMapLayer* layer, const QgsFeature &feat );

//! Updates the "set as atlas feature" map layer action when atlas coverage layer changes
void updateAtlasMapLayerAction( QgsVectorLayer* coverageLayer );
Expand Down

0 comments on commit 307d4bd

Please sign in to comment.