Skip to content
Permalink
Browse files

fixed rashes in atlas calling vector methods for rasters, fixes #7963

  • Loading branch information
blazek committed Jun 4, 2013
1 parent 383e7f1 commit f9a0a1d1c89a4483b3eb0c66c252e44ed816364c
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/app/composer/qgsatlascompositionwidget.cpp
@@ -132,11 +132,12 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
if ( vectorLayer )
{
mAtlasCoverageLayerComboBox->addItem( map->name(), qVariantFromValue(( void* )map ) );
}
if ( mAtlasCoverageLayerComboBox->count() == 1 )
{
atlasMap->setCoverageLayer( vectorLayer );
checkLayerType( vectorLayer );

if ( mAtlasCoverageLayerComboBox->count() == 1 )
{
atlasMap->setCoverageLayer( vectorLayer );
checkLayerType( vectorLayer );
}
}
}

@@ -186,8 +187,11 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
{
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->itemData( index ).value<void*>() );

checkLayerType( layer );
atlasMap->setCoverageLayer( layer );
if ( layer )
{
checkLayerType( layer );
atlasMap->setCoverageLayer( layer );
}

// update sorting columns
fillSortColumns();
@@ -197,6 +201,7 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
void QgsAtlasCompositionWidget::checkLayerType( QgsVectorLayer *layer )
{
// enable or disable fixed scale control based on layer type
if ( !layer ) return;
switch ( layer->wkbType() )
{
case QGis::WKBPoint:

0 comments on commit f9a0a1d

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