Skip to content

Commit

Permalink
fixed rashes in atlas calling vector methods for rasters, fixes #7963
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jun 4, 2013
1 parent 383e7f1 commit f9a0a1d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/app/composer/qgsatlascompositionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
}

Expand Down Expand Up @@ -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();
Expand All @@ -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:
Expand Down

0 comments on commit f9a0a1d

Please sign in to comment.