Index: src/core/qgsmaprenderer.cpp =================================================================== --- src/core/qgsmaprenderer.cpp (revision 15676) +++ src/core/qgsmaprenderer.cpp (working copy) @@ -838,10 +838,11 @@ // We can't use a constructor since QgsRectangle normalizes the rectangle upon construction mFullExtent.setMinimal(); + QList list = registry->mapLayers().keys(); // iterate through the map layers and test each layers extent // against the current min and max values - QStringList::iterator it = mLayerSet.begin(); - while ( it != mLayerSet.end() ) + QStringList::iterator it = list.begin(); + while ( it != list.end() ) { QgsMapLayer * lyr = registry->mapLayer( *it ); if ( lyr == NULL ) @@ -861,7 +862,7 @@ mFullExtent.unionRect( extent ); } - it++; + ++it; } if ( mFullExtent.width() == 0.0 || mFullExtent.height() == 0.0 )