Skip to content
Permalink
Browse files

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
mhugent committed Oct 11, 2010
1 parent f13d3f3 commit 7579e22e591445bfe584e31ca1e13021b3c10c57
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/composer/qgscomposerattributetable.cpp
@@ -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& ) ) );
}

0 comments on commit 7579e22

Please sign in to comment.
You can’t perform that action at this time.