Skip to content

Commit

Permalink
Fixed a crash (clicking zoom to layer with no active layer)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15588 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 23, 2011
1 parent a35ef61 commit 2cddedf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,9 @@ void QgsLegend::legendLayerZoom()

QgsLegendItem* li = dynamic_cast<QgsLegendItem *>( currentItem() );

if ( !li )
return;

if ( li->type() == QgsLegendItem::LEGEND_LAYER )
{
QgsLegendLayer* currentLayer = dynamic_cast<QgsLegendLayer *>( currentItem() );
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5790,11 +5790,13 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionLocalHistogramStretch->setEnabled( false );
mActionFullHistogramStretch->setEnabled( false );
mActionZoomActualSize->setEnabled( false );
mActionZoomToLayer->setEnabled( false );
return;
}

mActionLayerProperties->setEnabled( true );
mActionAddToOverview->setEnabled( true );
mActionZoomToLayer->setEnabled( true );

/***********Vector layers****************/
if ( layer->type() == QgsMapLayer::VectorLayer )
Expand Down

0 comments on commit 2cddedf

Please sign in to comment.