Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix side effect of last commit
git-svn-id: http://svn.osgeo.org/qgis/trunk@14368 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 11, 2010
1 parent f13d3f3 commit 7579e22
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/composer/qgscomposerattributetable.cpp
Expand Up @@ -46,6 +46,18 @@ bool QgsComposerAttributeTableCompare::operator()( const QgsAttributeMap& m1, co
QgsComposerAttributeTable::QgsComposerAttributeTable( QgsComposition* composition ): QgsComposerTable( composition ), mVectorLayer( 0 ), mComposerMap( 0 ), \
mMaximumNumberOfFeatures( 5 ), mShowOnlyVisibleFeatures( true )
{
//set first vector layer from layer registry as default one
QMap<QString, QgsMapLayer*> layerMap = QgsMapLayerRegistry::instance()->mapLayers();
QMap<QString, QgsMapLayer*>::const_iterator mapIt = layerMap.constBegin();
for ( ; mapIt != layerMap.constEnd(); ++mapIt )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( mapIt.value() );
if ( vl )
{
mVectorLayer = vl;
break;
}
}
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( removeLayer( const QString& ) ) );
}

Expand Down

0 comments on commit 7579e22

Please sign in to comment.