Skip to content

Commit d666dad

Browse files
author
jef
committed
fix r15352
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15359 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent cfe6c08 commit d666dad

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/app/legend/qgslegend.cpp

+1-15
Original file line numberDiff line numberDiff line change
@@ -799,29 +799,15 @@ void QgsLegend::setGroupCRS( QgsLegendGroup *lg, const QgsCoordinateReferenceSys
799799
return;
800800
}
801801

802-
//delete the legend layers first
803-
QTreeWidgetItem * child = lg->child( 0 );
804-
while ( child )
802+
foreach( QgsLegendLayer *cl, lg->legendLayers() )
805803
{
806-
QgsLegendLayer *cl = dynamic_cast<QgsLegendLayer *>( child );
807-
QgsLegendGroup *cg = dynamic_cast<QgsLegendGroup *>( child );
808-
809804
if ( cl )
810805
{
811806
cl->layer()->setCrs( crs );
812807
}
813-
else if ( cg )
814-
{
815-
setGroupCRS( cg, crs );
816-
}
817-
818-
child = lg->child( 0 );
819808
}
820-
821-
delete lg;
822809
}
823810

824-
825811
void QgsLegend::moveLayer( QgsMapLayer *ml, int groupIndex )
826812
{
827813
if ( !ml )

0 commit comments

Comments
 (0)