Skip to content

Commit d5a55a9

Browse files
author
wonder
committedDec 16, 2010
Fixed a crash when refreshing layer symbology - if the currently selected item has been removed (#3326 and #3003)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14934 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ void QgsLegend::refreshLayerSymbology( QString key, bool expandItem )
14741474
}
14751475

14761476
//store the current item
1477-
QTreeWidgetItem* theCurrentItem = currentItem();
1477+
QModelIndex currentItemIndex( currentIndex() );
14781478

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

14871487
//restore the current item again
1488-
setCurrentItem( theCurrentItem );
1488+
setCurrentIndex( currentItemIndex );
14891489
adjustIconSize();
14901490
if ( expandItem )
14911491
{

0 commit comments

Comments
 (0)
Please sign in to comment.