The following commit has been merged in the master branch: commit e71494a5607b5c9792415e3652c5b8797d1f5e73 Author: Marco Hugentobler <marco.hugentob...@sourcepole.ch> Date: Wed Mar 7 14:03:31 2012 +0100
Fix wrong extent after loading project files with embedded groups diff --git a/src/app/legend/qgslegend.cpp b/src/app/legend/qgslegend.cpp index 7cf17c9..7d7895f 100644 --- a/src/app/legend/qgslegend.cpp +++ b/src/app/legend/qgslegend.cpp @@ -1319,6 +1319,12 @@ bool QgsLegend::writeXML( QList<QTreeWidgetItem *> items, QDomNode &node, QDomDo bool QgsLegend::readXML( QgsLegendGroup *parent, const QDomNode &node ) { + QgsRectangle bkMapExtent; + if ( mMapCanvas ) + { + bkMapExtent = mMapCanvas->extent(); + } + const QDomNodeList &l = node.childNodes(); for ( int i = 0; i < l.count(); i++ ) { @@ -1444,6 +1450,11 @@ bool QgsLegend::readXML( QgsLegendGroup *parent, const QDomNode &node ) } } + //restore canvas extent (could be changed by addLayer calls) + if ( !bkMapExtent.isEmpty() ) + { + mMapCanvas->setExtent( bkMapExtent ); + } return true; } -- The Quantum GIS in Debian project _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel