Skip to content

Commit

Permalink
Fixed a crash when refreshing layer symbology - if the currently sele…
Browse files Browse the repository at this point in the history
…cted item has been removed (#3326 and #3003)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14934 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 16, 2010
1 parent 0e6093f commit d5a55a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ void QgsLegend::refreshLayerSymbology( QString key, bool expandItem )
}

//store the current item
QTreeWidgetItem* theCurrentItem = currentItem();
QModelIndex currentItemIndex( currentIndex() );

double widthScale = 1.0;
if ( mMapCanvas && mMapCanvas->map() )
Expand All @@ -1485,7 +1485,7 @@ void QgsLegend::refreshLayerSymbology( QString key, bool expandItem )
theLegendLayer->refreshSymbology( key, widthScale );

//restore the current item again
setCurrentItem( theCurrentItem );
setCurrentIndex( currentItemIndex );
adjustIconSize();
if ( expandItem )
{
Expand Down

0 comments on commit d5a55a9

Please sign in to comment.