@@ -85,7 +85,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
8585 setScene ( mScene );
8686 setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
8787 setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
88- mLastExtentIndex = -1 ;
88+ mLastExtentIndex = -1 ;
8989 mCurrentLayer = NULL ;
9090 mMapOverview = NULL ;
9191 mMapTool = NULL ;
@@ -436,7 +436,7 @@ void QgsMapCanvas::saveAsImage( QString theFileName, QPixmap * theQPixmap, QStri
436436 // allow dotted names
437437 QString myWorldFileName = myInfo.absolutePath () + QDir::separator () + myInfo.completeBaseName () + " ." + theFormat + " w" ;
438438 QFile myWorldFile ( myWorldFileName );
439- if ( !myWorldFile.open ( QIODevice::WriteOnly ) ) // don't use QIODevice::Text
439+ if ( !myWorldFile.open ( QIODevice::WriteOnly ) ) // don't use QIODevice::Text
440440 {
441441 return ;
442442 }
@@ -495,17 +495,17 @@ void QgsMapCanvas::setExtent( QgsRectangle const & r )
495495 updateScale ();
496496 if ( mMapOverview )
497497 mMapOverview ->drawExtentRect ();
498- if (mLastExtent .size ()> 20 ) mLastExtent .removeAt (0 );
498+ if ( mLastExtent .size () > 20 ) mLastExtent .removeAt ( 0 );
499499
500500 // clear all extent items after current index
501- for (int i= mLastExtent .size ()- 1 ; i> mLastExtentIndex ; i--)
501+ for ( int i = mLastExtent .size () - 1 ; i > mLastExtentIndex ; i-- )
502502 {
503- mLastExtent .removeAt (i );
503+ mLastExtent .removeAt ( i );
504504 }
505505
506506
507- mLastExtent .append (extent ()) ;
508- mLastExtentIndex = mLastExtent .size ()- 1 ;
507+ mLastExtent .append ( extent () ) ;
508+ mLastExtentIndex = mLastExtent .size () - 1 ;
509509 // notify canvas items of change
510510 updateCanvasItemPositions ();
511511
@@ -552,40 +552,40 @@ void QgsMapCanvas::zoomToFullExtent()
552552
553553void QgsMapCanvas::zoomToPreviousExtent ()
554554{
555- if ( mDrawing )
556- {
557- return ;
558- }
559-
560- if (mLastExtentIndex > 1 )
561- {
562- mLastExtentIndex --;
563- mMapRenderer ->setExtent (mLastExtent [mLastExtentIndex ]);
564- emit extentsChanged ();
565- updateScale ();
566- if ( mMapOverview )
567- mMapOverview ->drawExtentRect ();
568- }
555+ if ( mDrawing )
556+ {
557+ return ;
558+ }
559+
560+ if ( mLastExtentIndex > 1 )
561+ {
562+ mLastExtentIndex --;
563+ mMapRenderer ->setExtent ( mLastExtent [mLastExtentIndex ] );
564+ emit extentsChanged ();
565+ updateScale ();
566+ if ( mMapOverview )
567+ mMapOverview ->drawExtentRect ();
568+ }
569569
570570 refresh ();
571571} // zoomToPreviousExtent
572572
573573void QgsMapCanvas::zoomToNextExtent ()
574574{
575- if ( mDrawing )
576- {
577- return ;
578- }
579- if (mLastExtentIndex < mLastExtent .size ()- 1 )
580- {
581- mLastExtentIndex ++;
582- mMapRenderer ->setExtent (mLastExtent [mLastExtentIndex ]);
583- emit extentsChanged ();
584- updateScale ();
585- if ( mMapOverview )
586- mMapOverview ->drawExtentRect ();
587- }
588- refresh ();
575+ if ( mDrawing )
576+ {
577+ return ;
578+ }
579+ if ( mLastExtentIndex < mLastExtent .size () - 1 )
580+ {
581+ mLastExtentIndex ++;
582+ mMapRenderer ->setExtent ( mLastExtent [mLastExtentIndex ] );
583+ emit extentsChanged ();
584+ updateScale ();
585+ if ( mMapOverview )
586+ mMapOverview ->drawExtentRect ();
587+ }
588+ refresh ();
589589}// zoomToNextExtent
590590
591591
0 commit comments