@@ -721,28 +721,28 @@ static QString _getVersion(QDomDocument const &doc)
721721*/
722722static QgsMapCanvas * _findMapCanvas (QString const &canonicalMapCanvasName)
723723{
724- QgsMapCanvas * theMapCanvas = 0x0 ;
725-
726- QWidgetList wlist = QApplication::topLevelWidgets ();
727- foreach (QWidget *widget, QApplication::topLevelWidgets ())
728- {
729- theMapCanvas = dynamic_cast <QgsMapCanvas *>(widget->child (canonicalMapCanvasName));
730- if (theMapCanvas)
731- {
732- break ;
733- }
734- }
724+ QgsMapCanvas * theMapCanvas = 0x0 ;
735725
726+ QWidgetList wlist = QApplication::topLevelWidgets ();
727+ foreach (QWidget *widget, QApplication::topLevelWidgets ())
728+ {
729+ theMapCanvas = dynamic_cast <QgsMapCanvas *>(widget->child (canonicalMapCanvasName));
736730 if (theMapCanvas)
737731 {
738- return theMapCanvas;
739- } else
740- {
741- qDebug ((" Unable to find canvas widget " + canonicalMapCanvasName).toLocal8Bit ().data ());
742-
743- return 0x0 ; // XXX some sort of error value? Exception?
732+ break ;
744733 }
734+ }
735+
736+ if (theMapCanvas)
737+ {
738+ return theMapCanvas;
739+ }
740+ else
741+ {
742+ qDebug ((" Unable to find canvas widget " + canonicalMapCanvasName).toLocal8Bit ().data ());
745743
744+ return 0x0 ; // XXX some sort of error value? Exception?
745+ }
746746} // _findMapCanvas
747747
748748
@@ -1125,9 +1125,7 @@ bool QgsProject::read()
11251125
11261126 // ensure that overview map canvas is set to *entire* extent
11271127 QgsRect mapCanvasFullExtent = _getFullExtent (" theMapCanvas" );
1128- std::cerr <<__FILE__<<__LINE__<<' \n ' ;
11291128 _setCanvasExtent (" theOverviewCanvas" , mapCanvasFullExtent);
1130- std::cerr <<__FILE__<<__LINE__<<' \n ' ;
11311129 // now restore the extent for the main canvas
11321130 _setCanvasExtent (" theMapCanvas" , savedExtent);
11331131
0 commit comments