[QGIS Commit] r15359 - trunk/qgis/src/app/legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Mar 6 06:33:22 EST 2011


Author: jef
Date: 2011-03-06 03:33:22 -0800 (Sun, 06 Mar 2011)
New Revision: 15359

Modified:
   trunk/qgis/src/app/legend/qgslegend.cpp
Log:
fix r15352

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2011-03-06 09:50:50 UTC (rev 15358)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2011-03-06 11:33:22 UTC (rev 15359)
@@ -799,29 +799,15 @@
     return;
   }
 
-  //delete the legend layers first
-  QTreeWidgetItem * child = lg->child( 0 );
-  while ( child )
+  foreach( QgsLegendLayer *cl, lg->legendLayers() )
   {
-    QgsLegendLayer *cl = dynamic_cast<QgsLegendLayer *>( child );
-    QgsLegendGroup *cg = dynamic_cast<QgsLegendGroup *>( child );
-
     if ( cl )
     {
       cl->layer()->setCrs( crs );
     }
-    else if ( cg )
-    {
-      setGroupCRS( cg, crs );
-    }
-
-    child = lg->child( 0 );
   }
-
-  delete lg;
 }
 
-
 void QgsLegend::moveLayer( QgsMapLayer *ml, int groupIndex )
 {
   if ( !ml )



More information about the QGIS-commit mailing list