[QGIS Commit] r9366 - in trunk/qgis/src: app app/composer app/legend core core/composer core/raster gui plugins/grass providers/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Sep 21 07:48:21 EDT 2008


Author: jef
Date: 2008-09-21 07:48:21 -0400 (Sun, 21 Sep 2008)
New Revision: 9366

Modified:
   trunk/qgis/src/app/composer/qgscomposer.cpp
   trunk/qgis/src/app/composer/qgscomposermapwidget.cpp
   trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
   trunk/qgis/src/app/qgsattributetable.cpp
   trunk/qgis/src/app/qgsmaptoolidentify.cpp
   trunk/qgis/src/app/qgsmaptoolselect.cpp
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/core/composer/qgscomposeritem.h
   trunk/qgis/src/core/composer/qgscomposermap.cpp
   trunk/qgis/src/core/composer/qgscomposermap.h
   trunk/qgis/src/core/composer/qgscomposerpicture.cpp
   trunk/qgis/src/core/qgsgeometry.h
   trunk/qgis/src/core/qgsmaprenderer.cpp
   trunk/qgis/src/core/qgsmaprenderer.h
   trunk/qgis/src/core/qgsscalecalculator.cpp
   trunk/qgis/src/core/qgssnapper.cpp
   trunk/qgis/src/core/qgsvectorfilewriter.cpp
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.cpp
   trunk/qgis/src/core/raster/qgsrasterpyramid.h
   trunk/qgis/src/gui/qgscomposerview.cpp
   trunk/qgis/src/gui/qgscomposerview.h
   trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
   trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp
   trunk/qgis/src/plugins/grass/qgsgrassregion.cpp
   trunk/qgis/src/providers/grass/qgsgrass.cpp
   trunk/qgis/src/providers/grass/qgsgrassprovider.cpp
Log:
automatic indentation update (r9281-r9365)

Modified: trunk/qgis/src/app/composer/qgscomposer.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposer.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/composer/qgscomposer.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -435,10 +435,10 @@
     return;
   }
 
-  if(containsWMSLayer())
-    {
-      showWMSPrintingWarning();
-    }
+  if ( containsWMSLayer() )
+  {
+    showWMSPrintingWarning();
+  }
 
   QPrinter printer;
 
@@ -492,10 +492,10 @@
 
 void QgsComposer::on_mActionExportAsImage_activated( void )
 {
-  if(containsWMSLayer())
-    {
-      showWMSPrintingWarning();
-    }
+  if ( containsWMSLayer() )
+  {
+    showWMSPrintingWarning();
+  }
 
   // Image size
   int width = ( int )( mComposition->printoutResolution() * mComposition->paperWidth() / 25.4 );
@@ -567,7 +567,7 @@
     )
   );
 
-  myQFileDialog->setFileMode(QFileDialog::AnyFile);
+  myQFileDialog->setFileMode( QFileDialog::AnyFile );
 
   // set the filter to the last one used
   myQFileDialog->selectFilter( myLastUsedFilter );
@@ -587,7 +587,7 @@
   }
 
   myOutputFileNameQString = myQFileDialog->selectedFiles().last();
-  qWarning(myOutputFileNameQString.toLocal8Bit().data());
+  qWarning( myOutputFileNameQString.toLocal8Bit().data() );
   QString myFilterString = myQFileDialog->selectedFilter();
   QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
   QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
@@ -618,10 +618,10 @@
 
 void QgsComposer::on_mActionExportAsSVG_activated( void )
 {
-  if(containsWMSLayer())
-    {
-      showWMSPrintingWarning();
-    }
+  if ( containsWMSLayer() )
+  {
+    showWMSPrintingWarning();
+  }
 
   QString myQSettingsLabel = "/UI/displaySVGWarning";
   QSettings myQSettings;
@@ -1102,18 +1102,18 @@
   QgsComposerItem* currentItem = 0;
   QgsComposerMap* currentMap = 0;
 
-  for(; item_it != mItemWidgetMap.constEnd(); ++item_it)
+  for ( ; item_it != mItemWidgetMap.constEnd(); ++item_it )
+  {
+    currentItem = item_it.key();
+    currentMap = dynamic_cast<QgsComposerMap*>( currentItem );
+    if ( currentMap )
     {
-      currentItem = item_it.key();
-      currentMap = dynamic_cast<QgsComposerMap*>(currentItem);
-      if(currentMap)
-	{
-	  if(currentMap->containsWMSLayer())
-	    {
-	      return true;
-	    }
-	}
+      if ( currentMap->containsWMSLayer() )
+      {
+        return true;
+      }
     }
+  }
   return false;
 }
 
@@ -1123,15 +1123,15 @@
   QSettings myQSettings;
 
   bool displayWMSWarning = myQSettings.value( myQSettingsLabel, true ).toBool();
-  if(displayWMSWarning)
-    {
-      QgsMessageViewer* m = new QgsMessageViewer( this );
-      m->setWindowTitle( tr( "Project contains WMS layers" ) );
-      m->setMessage(tr("Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed"), QgsMessageOutput::MessageText);
-      m->setCheckBoxText( tr( "Don't show this message again" ) );
-      m->setCheckBoxState( Qt::Unchecked );
-      m->setCheckBoxVisible( true );
-      m->setCheckBoxQSettingsLabel( myQSettingsLabel );
-      m->exec();
-    }
+  if ( displayWMSWarning )
+  {
+    QgsMessageViewer* m = new QgsMessageViewer( this );
+    m->setWindowTitle( tr( "Project contains WMS layers" ) );
+    m->setMessage( tr( "Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed" ), QgsMessageOutput::MessageText );
+    m->setCheckBoxText( tr( "Don't show this message again" ) );
+    m->setCheckBoxState( Qt::Unchecked );
+    m->setCheckBoxVisible( true );
+    m->setCheckBoxQSettingsLabel( myQSettingsLabel );
+    m->exec();
+  }
 }

Modified: trunk/qgis/src/app/composer/qgscomposermapwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposermapwidget.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/composer/qgscomposermapwidget.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -230,10 +230,10 @@
 
     //composer map extent
     QgsRect composerMapExtent = mComposerMap->extent();
-    mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3));
-    mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3));
-    mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3));
-    mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3));
+    mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3 ) );
+    mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3 ) );
+    mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3 ) );
+    mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3 ) );
   }
 }
 

Modified: trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -274,11 +274,11 @@
   {
     destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
   }
-  
+
   QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
   mySelector->setSelectedCrsId( destCRS.srsid() );
-  mySelector->setMessage(tr("Select the coordinate reference system for the saved shapefile.") +
-                         tr("The data points will be transformed from the layer coordinate reference system."));
+  mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile." ) +
+                          tr( "The data points will be transformed from the layer coordinate reference system." ) );
 
   if ( mySelector->exec() )
   {

Modified: trunk/qgis/src/app/qgsattributetable.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributetable.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/qgsattributetable.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -559,7 +559,7 @@
   for ( QList<QTableWidgetSelectionRange>::iterator iter = selections.begin();iter != selections.end();++iter )
   {
     removeselection = true;
-    while ( swaptorow<rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
+    while ( swaptorow < rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
     {
       ++swaptorow;
     }

Modified: trunk/qgis/src/app/qgsmaptoolidentify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolidentify.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/qgsmaptoolidentify.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -252,7 +252,7 @@
 
   // toLayerCoordinates will throw an exception for an 'invalid' point.
   // For example, if you project a world map onto a globe using EPSG 2163
-  // and then click somewhere off the globe, an exception will be thrown. 
+  // and then click somewhere off the globe, an exception will be thrown.
   try
   {
     // create the search rectangle

Modified: trunk/qgis/src/app/qgsmaptoolselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolselect.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/qgsmaptoolselect.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -96,7 +96,7 @@
   QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( mCanvas->currentLayer() );
   // toLayerCoordinates will throw an exception for an 'invalid' rectangle.
   // For example, if you project a world map onto a globe using EPSG 2163
-  // and then click somewhere off the globe, an exception will be thrown. 
+  // and then click somewhere off the globe, an exception will be thrown.
   try
   {
     search = toLayerCoordinates( vlayer, search );

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -1384,7 +1384,7 @@
         myNewColorRampItem.value = myCurrentItem->text( 0 ).toDouble();
         myNewColorRampItem.color = myCurrentItem->background( 1 ).color();
         myNewColorRampItem.label = myCurrentItem->text( 2 );
-        
+
         //Simple insertion sort - speed is not a huge factor here
         inserted = false;
         myCurrentIndex = 0;
@@ -1590,9 +1590,9 @@
     {
       QMessageBox::warning( this, tr( "Building pyramids failed." ),
                             tr( "Building pyramid overviews is not supported on this type of raster." ) );
-                            //TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
+      //TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
     }
-    
+
   }
 
 
@@ -2649,7 +2649,7 @@
     {
       item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
       //show color dialog
-      QColor newColor = QColorDialog::getColor(item->background(column).color());
+      QColor newColor = QColorDialog::getColor( item->background( column ).color() );
       if ( newColor.isValid() )
       {
         item->setBackground( 1, QBrush( newColor ) );

Modified: trunk/qgis/src/core/composer/qgscomposeritem.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposeritem.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/composer/qgscomposeritem.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -79,7 +79,7 @@
      @param delta value from wheel event that describes magnitude and direction (positive /negative number)
     @param x x-position of mouse cursor (in item coordinates)
     @param y y-position of mouse cursor (in item coordinates)*/
-    virtual void zoomContent( int delta, double x, double y) {}
+    virtual void zoomContent( int delta, double x, double y ) {}
 
     /**Sets this items bound in scene coordinates such that 1 item size units
      corresponds to 1 scene size unit*/

Modified: trunk/qgis/src/core/composer/qgscomposermap.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/composer/qgscomposermap.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -280,62 +280,62 @@
   }
 }
 
-void QgsComposerMap::zoomContent( int delta, double x, double y)
+void QgsComposerMap::zoomContent( int delta, double x, double y )
 {
   QSettings settings;
-  
+
   //read zoom mode
-  //0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing 
-  int zoomMode = settings.value("/qgis/wheel_action", 0 ).toInt();
-  if(zoomMode == 3) //do nothing
-    {
-      return;
-    }
+  //0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing
+  int zoomMode = settings.value( "/qgis/wheel_action", 0 ).toInt();
+  if ( zoomMode == 3 ) //do nothing
+  {
+    return;
+  }
 
-  double zoomFactor = settings.value("/qgis/zoom_factor", 2.0).toDouble();
-  
+  double zoomFactor = settings.value( "/qgis/zoom_factor", 2.0 ).toDouble();
+
   //find out new center point
-  double centerX = (mExtent.xMax() + mExtent.xMin()) / 2;
-  double centerY = (mExtent.yMax() + mExtent.yMin()) / 2;
+  double centerX = ( mExtent.xMax() + mExtent.xMin() ) / 2;
+  double centerY = ( mExtent.yMax() + mExtent.yMin() ) / 2;
 
-  if(zoomMode != 0)
+  if ( zoomMode != 0 )
+  {
+    //find out map coordinates of mouse position
+    double mapMouseX = mExtent.xMin() + ( x / rect().width() ) * ( mExtent.xMax() - mExtent.xMin() );
+    double mapMouseY = mExtent.yMin() + ( 1 - ( y / rect().height() ) ) * ( mExtent.yMax() - mExtent.yMin() );
+    if ( zoomMode == 1 ) //zoom and recenter
     {
-      //find out map coordinates of mouse position
-      double mapMouseX = mExtent.xMin() + (x / rect().width()) * (mExtent.xMax() - mExtent.xMin());
-      double mapMouseY = mExtent.yMin() + (1 - (y / rect().height())) * (mExtent.yMax() - mExtent.yMin());
-      if(zoomMode == 1) //zoom and recenter
-	{
-	  centerX = mapMouseX;
-	  centerY = mapMouseY;
-	}
-      else if(zoomMode == 2) //zoom to cursor
-	{
-	  centerX = mapMouseX + (centerX - mapMouseX) * (1.0 / zoomFactor);
-	  centerY = mapMouseY + (centerY - mapMouseY) * (1.0 / zoomFactor);
-	}
+      centerX = mapMouseX;
+      centerY = mapMouseY;
     }
+    else if ( zoomMode == 2 ) //zoom to cursor
+    {
+      centerX = mapMouseX + ( centerX - mapMouseX ) * ( 1.0 / zoomFactor );
+      centerY = mapMouseY + ( centerY - mapMouseY ) * ( 1.0 / zoomFactor );
+    }
+  }
 
   double newIntervalX, newIntervalY;
 
-  if(delta > 0)
-    {
-      newIntervalX = (mExtent.xMax() - mExtent.xMin()) / zoomFactor;
-      newIntervalY = (mExtent.yMax() - mExtent.yMin()) / zoomFactor;
-    }
-  else if(delta < 0)
-    {
-      newIntervalX = (mExtent.xMax() - mExtent.xMin()) * zoomFactor;
-      newIntervalY = (mExtent.yMax() - mExtent.yMin()) * zoomFactor;
-    }
+  if ( delta > 0 )
+  {
+    newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) / zoomFactor;
+    newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) / zoomFactor;
+  }
+  else if ( delta < 0 )
+  {
+    newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) * zoomFactor;
+    newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) * zoomFactor;
+  }
   else //no need to zoom
-    {
-      return;
-    }
+  {
+    return;
+  }
 
-  mExtent.setXMaximum(centerX + newIntervalX / 2);
-  mExtent.setXMinimum(centerX - newIntervalX / 2);
-  mExtent.setYMaximum(centerY + newIntervalY / 2);
-  mExtent.setYMinimum(centerY - newIntervalY / 2);
+  mExtent.setXMaximum( centerX + newIntervalX / 2 );
+  mExtent.setXMinimum( centerX - newIntervalX / 2 );
+  mExtent.setYMaximum( centerY + newIntervalY / 2 );
+  mExtent.setYMinimum( centerY - newIntervalY / 2 );
 
   emit extentChanged();
   cache();
@@ -405,35 +405,35 @@
 
 bool QgsComposerMap::containsWMSLayer() const
 {
-  if(!mMapRenderer)
-    {
-      return false;
-    }
+  if ( !mMapRenderer )
+  {
+    return false;
+  }
 
   QStringList layers = mMapRenderer->layerSet();
 
   QStringList::const_iterator layer_it = layers.constBegin();
   QgsMapLayer* currentLayer = 0;
 
-  for(; layer_it != layers.constEnd(); ++layer_it)
+  for ( ; layer_it != layers.constEnd(); ++layer_it )
+  {
+    currentLayer = QgsMapLayerRegistry::instance()->mapLayer( *layer_it );
+    if ( currentLayer )
     {
-      currentLayer = QgsMapLayerRegistry::instance()->mapLayer(*layer_it);
-      if(currentLayer)
-	{
-	  QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>(currentLayer);
-	  if(currentRasterLayer)
-	    {
-	      const QgsRasterDataProvider* rasterProvider = 0;
-	      if(rasterProvider = currentRasterLayer->dataProvider())
-		{
-		  if(rasterProvider->name() == "wms")
-		    {
-		      return true;
-		    }
-		}
-	    }
-	}
+      QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
+      if ( currentRasterLayer )
+      {
+        const QgsRasterDataProvider* rasterProvider = 0;
+        if ( rasterProvider = currentRasterLayer->dataProvider() )
+        {
+          if ( rasterProvider->name() == "wms" )
+          {
+            return true;
+          }
+        }
+      }
     }
+  }
   return false;
 }
 

Modified: trunk/qgis/src/core/composer/qgscomposermap.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/composer/qgscomposermap.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -91,7 +91,7 @@
      @param delta value from wheel event that describes magnitude and direction (positive /negative number)
     @param x x-coordinate of mouse position in item coordinates
     @param y y-coordinate of mouse position in item coordinates*/
-    void zoomContent( int delta, double x, double y);
+    void zoomContent( int delta, double x, double y );
 
     /**Sets new scene rectangle bounds and recalculates hight and extent*/
     void setSceneRect( const QRectF& rectangle );

Modified: trunk/qgis/src/core/composer/qgscomposerpicture.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerpicture.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/composer/qgscomposerpicture.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -111,8 +111,8 @@
     {
       mMode = SVG;
       QRect viewBox = validTestRenderer.viewBox(); //take width/height ratio from view box instead of default size
-      mDefaultSvgSize.setWidth(viewBox.width());
-      mDefaultSvgSize.setHeight(viewBox.height());
+      mDefaultSvgSize.setWidth( viewBox.width() );
+      mDefaultSvgSize.setHeight( viewBox.height() );
       mSvgCacheUpToDate = false;
     }
     else
@@ -140,7 +140,7 @@
 {
   mImage.fill( 0 );
   QPainter p( &mImage );
-  p.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true);
+  p.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing, true );
   QSvgRenderer theRenderer( mSourceFile.fileName() );
   if ( theRenderer.isValid() )
   {

Modified: trunk/qgis/src/core/qgsgeometry.h
===================================================================
--- trunk/qgis/src/core/qgsgeometry.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsgeometry.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -245,7 +245,7 @@
     @param topological true if topological editing is enabled
     @topologyTestPoints OUT: points that need to be tested for topological completeness in the dataset
     @return 0 in case of success, 1 if geometry has not been split, error else*/
-    int splitGeometry( const QList<QgsPoint>& splitLine, QList<QgsGeometry*>& newGeometries, bool topological, QList<QgsPoint>& topologyTestPoints);
+    int splitGeometry( const QList<QgsPoint>& splitLine, QList<QgsGeometry*>& newGeometries, bool topological, QList<QgsPoint>& topologyTestPoints );
 
     /**Changes this geometry such that it does not intersect the other geometry
        @param other geometry that should not be intersect
@@ -400,13 +400,13 @@
      @splitLine the line that splits the feature
      @newGeometry new geometry if splitting was successful
      @return 0 in case of success, 1 if geometry has not been split, error else*/
-    int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>& newGeometries);
+    int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>& newGeometries );
     /**Splits polygon/multipolygon geometries
        @return 0 in case of success, 1 if geometry has not been split, error else*/
     int splitPolygonGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>& newGeometries );
     /**Finds out the points that need to be tested for topological correctnes if this geometry will be split
      @return 0 in case of success*/
-    int topologicalTestPointsSplit( const GEOSGeometry* splitLine, QList<QgsPoint>& testPoints) const;
+    int topologicalTestPointsSplit( const GEOSGeometry* splitLine, QList<QgsPoint>& testPoints ) const;
 
     /**Nodes together a split line and a (multi-) polygon geometry in a multilinestring
      @return the noded multiline geometry or 0 in case of error. The calling function takes ownership of the node geometry*/

Modified: trunk/qgis/src/core/qgsmaprenderer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsmaprenderer.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -241,10 +241,10 @@
   //because sometimes QPainter units are in a local coord sys (e.g. in case of QGraphicsScene)
   double sceneDpi = mScaleCalculator->dpi();
   double scaleFactor = 1.0;
-  if(mOutputUnits == QgsMapRenderer::MM)
-    {
-      scaleFactor = sceneDpi / 25.4;
-    }
+  if ( mOutputUnits == QgsMapRenderer::MM )
+  {
+    scaleFactor = sceneDpi / 25.4;
+  }
   double rasterScaleFactor = ( thePaintDevice->logicalDpiX() + thePaintDevice->logicalDpiY() ) / 2.0 / sceneDpi;
   mRenderContext.setScaleFactor( scaleFactor );
   mRenderContext.setRasterScaleFactor( rasterScaleFactor );

Modified: trunk/qgis/src/core/qgsmaprenderer.h
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsmaprenderer.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -44,8 +44,8 @@
 
   public:
 
-  /**Output units for pen width and point marker width/height*/
-  enum OUTPUT_UNITS
+    /**Output units for pen width and point marker width/height*/
+    enum OUTPUT_UNITS
     {
       MM,
       PIXEL
@@ -120,7 +120,7 @@
     //! returns CRS ID of destination spatial reference system
     const QgsCoordinateReferenceSystem& destinationSrs();
 
-    void setOutputUnits(OUTPUT_UNITS u){mOutputUnits = u;}
+    void setOutputUnits( OUTPUT_UNITS u ) {mOutputUnits = u;}
 
     OUTPUT_UNITS outputUnits() const {return mOutputUnits;}
 

Modified: trunk/qgis/src/core/qgsscalecalculator.cpp
===================================================================
--- trunk/qgis/src/core/qgsscalecalculator.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsscalecalculator.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -81,7 +81,7 @@
     QgsDebugMsg( "Can't calculate scale from the input values" );
     return 0;
   }
-  double scale = ( delta * conversionFactor ) / ( (double)canvasWidth / mDpi );
+  double scale = ( delta * conversionFactor ) / (( double )canvasWidth / mDpi );
   return scale;
 }
 

Modified: trunk/qgis/src/core/qgssnapper.cpp
===================================================================
--- trunk/qgis/src/core/qgssnapper.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgssnapper.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -101,22 +101,22 @@
     snappingResult.push_back( evalIt.value() );
   }
   else if ( mSnapMode == QgsSnapper::SEVERAL_RESULTS_SAME_POSITION )
-  {    
+  {
     //take all snapping Results within a certain tolerance because rounding differences may occur
     double tolerance = 0.000001;
     double minDistance = evalIt.key();
 
-    for(evalIt = snappingResultList.begin(); evalIt != snappingResultList.end(); ++evalIt)
+    for ( evalIt = snappingResultList.begin(); evalIt != snappingResultList.end(); ++evalIt )
+    {
+      if ( evalIt.key() > ( minDistance + tolerance ) )
       {
-	if(evalIt.key() > (minDistance + tolerance))
-	  {
-	    break;
-	  }
-	snappingResult.push_back(evalIt.value());
+        break;
       }
-    
+      snappingResult.push_back( evalIt.value() );
+    }
+
   }
-   
+
   else //take all results
   {
     for ( ;evalIt != snappingResultList.end(); ++evalIt )

Modified: trunk/qgis/src/core/qgsvectorfilewriter.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorfilewriter.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsvectorfilewriter.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -309,10 +309,12 @@
     // This means we should transform
     outputCRS = destCRS;
     shallTransform = true;
-  } else {
+  }
+  else
+  {
     // This means we shouldn't transform, use source CRS as output (if defined)
     outputCRS = &layer->srs();
-  }  
+  }
   QgsVectorFileWriter* writer = new QgsVectorFileWriter( shapefileName,
       fileEncoding, provider->fields(), provider->geometryType(), outputCRS );
 
@@ -320,7 +322,7 @@
   WriterError err = writer->hasError();
   if ( err != NoError )
   {
-    if (ct != NULL)
+    if ( ct != NULL )
     {
       delete ct;
     }
@@ -336,13 +338,13 @@
   const QgsFeatureIds& ids = layer->selectedFeaturesIds();
 
   // Create our transform
-  if (destCRS)
+  if ( destCRS )
   {
-    ct = new QgsCoordinateTransform(layer->srs(), *destCRS);
+    ct = new QgsCoordinateTransform( layer->srs(), *destCRS );
   }
 
   // Check for failure
-  if (ct == NULL)
+  if ( ct == NULL )
   {
     shallTransform = false;
   }
@@ -355,14 +357,14 @@
 
     if ( shallTransform )
     {
-      fet.geometry()->transform(*ct);
+      fet.geometry()->transform( *ct );
     }
     writer->addFeature( fet );
   }
 
   delete writer;
 
-  if (shallTransform)
+  if ( shallTransform )
   {
     delete ct;
   }

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -1724,7 +1724,7 @@
     QList<QgsGeometry*> newGeometries;
     QList<QgsPoint> topologyTestPoints;
     QgsGeometry* newGeometry = 0;
-    splitFunctionReturn = select_it->geometry()->splitGeometry( splitLine, newGeometries, topologicalEditing, topologyTestPoints);
+    splitFunctionReturn = select_it->geometry()->splitGeometry( splitLine, newGeometries, topologicalEditing, topologyTestPoints );
     if ( splitFunctionReturn == 0 )
     {
       //change this geometry
@@ -1741,14 +1741,14 @@
       }
 
       setModified( true, true );
-      if(topologicalEditing)
-	{
-	  QList<QgsPoint>::const_iterator topol_it = topologyTestPoints.constBegin();
-	  for(; topol_it != topologyTestPoints.constEnd(); ++topol_it)
-	    {
-	      addTopologicalPoints(*topol_it);
-	    }
-	}
+      if ( topologicalEditing )
+      {
+        QList<QgsPoint>::const_iterator topol_it = topologyTestPoints.constBegin();
+        for ( ; topol_it != topologyTestPoints.constEnd(); ++topol_it )
+        {
+          addTopologicalPoints( *topol_it );
+        }
+      }
     }
     else if ( splitFunctionReturn > 1 ) //1 means no split but also no error
     {

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -3398,7 +3398,7 @@
 {
   //TODO: Consider making theRasterPyramidList modifyable by this method to indicate if the pyramid exists after build attempt
   //without requiring the user to rebuild the pyramid list to get the updated infomation
-  
+
   //
   // Note: Make sure the raster is not opened in write mode
   // in order to force overviews to be written to a separate file.
@@ -3437,7 +3437,7 @@
       return "ERROR_WRITE_FORMAT";
     }
   }
-  
+
   //
   // Iterate through the Raster Layer Pyramid Vector, building any pyramid
   // marked as exists in eaxh RasterPyramid struct.
@@ -3495,7 +3495,7 @@
           myError = GDALBuildOverviews( mGdalBaseDataset, "NEAREST", 1, myOverviewLevelsArray, 0, NULL,
                                         progressCallback, this ); //this is the arg for the gdal progress callback
         }
-        
+
         if ( myError == CE_Failure || CPLGetLastErrorNo() == CPLE_NotSupported )
         {
           //something bad happenend
@@ -3504,7 +3504,7 @@
           mGdalBaseDataset = GDALOpen( QFile::encodeName( mDataSource ).constData(), GA_ReadOnly );
           //Since we are not a virtual warped dataset, mGdalDataSet and mGdalBaseDataset are supposed to be the same
           mGdalDataset = mGdalBaseDataset;
-          
+
           emit drawingProgress( 0, 0 );
           return "FAILED_NOT_SUPPORTED";
         }
@@ -3514,7 +3514,7 @@
           hasPyramidsFlag = true;
         }
         myCount++;
-        
+
       }
       catch ( CPLErr )
       {
@@ -3522,7 +3522,7 @@
       }
     }
   }
-  
+
   QgsDebugMsg( "Pyramid overviews built" );
   if ( theTryInternalFlag )
   {
@@ -3532,7 +3532,7 @@
     //Since we are not a virtual warped dataset, mGdalDataSet and mGdalBaseDataset are supposed to be the same
     mGdalDataset = mGdalBaseDataset;
   }
-  
+
   emit drawingProgress( 0, 0 );
   return NULL; // returning null on success
 }

Modified: trunk/qgis/src/core/raster/qgsrasterpyramid.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterpyramid.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/core/raster/qgsrasterpyramid.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -33,7 +33,7 @@
     bool exists;
     /** \brief Whether the pyramid should be built */
     bool build;
-    
+
     QgsRasterPyramid()
     {
       level = 0;

Modified: trunk/qgis/src/gui/qgscomposerview.cpp
===================================================================
--- trunk/qgis/src/gui/qgscomposerview.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/gui/qgscomposerview.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -336,20 +336,20 @@
   }
 }
 
-void QgsComposerView::wheelEvent( QWheelEvent* event)
+void QgsComposerView::wheelEvent( QWheelEvent* event )
 {
   QPointF scenePoint = mapToScene( event->pos() );
-  
+
   //select topmost item at position of event
   QgsComposerItem* theItem = composition()->composerItemAt( scenePoint );
-  if (theItem)
+  if ( theItem )
+  {
+    if ( theItem->isSelected() )
     {
-      if(theItem->isSelected())
-	{
-	  QPointF itemPoint = theItem->mapFromScene(scenePoint);
-	  theItem->zoomContent(event->delta(), itemPoint.x(), itemPoint.y());
-	}
+      QPointF itemPoint = theItem->mapFromScene( scenePoint );
+      theItem->zoomContent( event->delta(), itemPoint.x(), itemPoint.y() );
     }
+  }
 }
 
 void QgsComposerView::setComposition( QgsComposition* c )

Modified: trunk/qgis/src/gui/qgscomposerview.h
===================================================================
--- trunk/qgis/src/gui/qgscomposerview.h	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/gui/qgscomposerview.h	2008-09-21 11:48:21 UTC (rev 9366)
@@ -79,7 +79,7 @@
     void keyPressEvent( QKeyEvent * e );
     void keyReleaseEvent( QKeyEvent * e );
 
-    void wheelEvent( QWheelEvent* event);
+    void wheelEvent( QWheelEvent* event );
 
   private:
     /**Status of shift key (used for multiple selection)*/

Modified: trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -1265,9 +1265,9 @@
     //       database path
     QgsGrass::activeMode(); // because it calls private gsGrass::init()
 #if defined(WIN32)
-    G__setenv( (char *) "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
+    G__setenv(( char * ) "GISDBASE", getShortPath( mDatabaseLineEdit->text() ).toAscii().data() );
 #else
-    G__setenv( (char *) "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
+    G__setenv(( char * ) "GISDBASE", mDatabaseLineEdit->text().toAscii().data() );
 #endif
 
     QgsGrass::resetError();

Modified: trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -548,7 +548,7 @@
   QgsGrass::setLocation( gisdbase, location );
 
   struct Cell_head window;
-  char *err = G__get_window( &window, (char *) "", (char *) "WIND", mapset.toLatin1().data() );
+  char *err = G__get_window( &window, ( char * ) "", ( char * ) "WIND", mapset.toLatin1().data() );
 
   if ( err )
   {

Modified: trunk/qgis/src/plugins/grass/qgsgrassregion.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassregion.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/plugins/grass/qgsgrassregion.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -165,7 +165,7 @@
   }
 
   QgsGrass::setLocation( gisdbase, location );
-  char *err = G__get_window( &mWindow, (char *) "", (char *) "WIND", mapset.toLatin1().data() );
+  char *err = G__get_window( &mWindow, ( char * ) "", ( char * ) "WIND", mapset.toLatin1().data() );
 
   if ( err )
   {
@@ -426,7 +426,7 @@
   }
 
   QgsGrass::setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
-  G__setenv( (char *) "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
+  G__setenv(( char * ) "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );
 
   if ( G_put_window( &mWindow ) == -1 )
   {

Modified: trunk/qgis/src/providers/grass/qgsgrass.cpp
===================================================================
--- trunk/qgis/src/providers/grass/qgsgrass.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/providers/grass/qgsgrass.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -314,12 +314,12 @@
 
   // Set principal GRASS variables (in memory)
 #if defined(WIN32)
-  G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
 #else
-  G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", gisdbase.toAscii().data() );
 #endif
-  G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
-  G__setenv( (char *) "MAPSET", (char *) "PERMANENT" ); // PERMANENT must always exist
+  G__setenv(( char * ) "LOCATION_NAME", location.toAscii().data() );
+  G__setenv(( char * ) "MAPSET", ( char * ) "PERMANENT" ); // PERMANENT must always exist
 
   // Add all available mapsets to search path
   char **ms = G_available_mapsets();
@@ -333,12 +333,12 @@
 
   // Set principal GRASS variables (in memory)
 #if defined(WIN32)
-  G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
 #else
-  G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", gisdbase.toAscii().data() );
 #endif
-  G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
-  G__setenv( (char *) "MAPSET", mapset.toAscii().data() );
+  G__setenv(( char * ) "LOCATION_NAME", location.toAscii().data() );
+  G__setenv(( char * ) "MAPSET", mapset.toAscii().data() );
 
   // Add all available mapsets to search path
   char **ms = G_available_mapsets();
@@ -557,14 +557,14 @@
   putenv( gisrcEnvChar );
 
   // Reinitialize GRASS
-  G__setenv( (char *) "GISRC", gisrcEnv.toAscii().data() );
+  G__setenv(( char * ) "GISRC", gisrcEnv.toAscii().data() );
 #if defined(WIN32)
-  G__setenv( (char *) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", getShortPath( gisdbase ).toAscii().data() );
 #else
-  G__setenv( (char *) "GISDBASE", gisdbase.toAscii().data() );
+  G__setenv(( char * ) "GISDBASE", gisdbase.toAscii().data() );
 #endif
-  G__setenv( (char *) "LOCATION_NAME", location.toAscii().data() );
-  G__setenv( (char *) "MAPSET", mapset.toAscii().data() );
+  G__setenv(( char * ) "LOCATION_NAME", location.toAscii().data() );
+  G__setenv(( char * ) "MAPSET", mapset.toAscii().data() );
   defaultGisdbase = gisdbase;
   defaultLocation = location;
   defaultMapset = mapset;
@@ -596,13 +596,13 @@
     }
     mMapsetLock = "";
 
-    putenv( (char *) "GISRC" );
+    putenv(( char * ) "GISRC" );
 
     // Reinitialize GRASS
-    G__setenv( (char *) "GISRC", (char *) "" );
-    G__setenv( (char *) "GISDBASE", (char *) "" );
-    G__setenv( (char *) "LOCATION_NAME", (char *) "" );
-    G__setenv( (char *) "MAPSET", (char *) "" );
+    G__setenv(( char * ) "GISRC", ( char * ) "" );
+    G__setenv(( char * ) "GISDBASE", ( char * ) "" );
+    G__setenv(( char * ) "LOCATION_NAME", ( char * ) "" );
+    G__setenv(( char * ) "MAPSET", ( char * ) "" );
     defaultGisdbase = "";
     defaultLocation = "";
     defaultMapset = "";
@@ -876,7 +876,7 @@
 {
   QgsGrass::setLocation( gisbase, location );
 
-  if ( G__get_window( window, (char *) "", (char *) "WIND", mapset.toLocal8Bit().data() ) )
+  if ( G__get_window( window, ( char * ) "", ( char * ) "WIND", mapset.toLocal8Bit().data() ) )
   {
     return false;
   }
@@ -1009,7 +1009,7 @@
   }
   else if ( type == Region )
   {
-    if ( G__get_window( window, (char *) "windows",
+    if ( G__get_window( window, ( char * ) "windows",
                         map.toLocal8Bit().data(),
                         mapset.toLocal8Bit().data() ) != NULL )
     {

Modified: trunk/qgis/src/providers/grass/qgsgrassprovider.cpp
===================================================================
--- trunk/qgis/src/providers/grass/qgsgrassprovider.cpp	2008-09-21 11:33:06 UTC (rev 9365)
+++ trunk/qgis/src/providers/grass/qgsgrassprovider.cpp	2008-09-21 11:48:21 UTC (rev 9366)
@@ -730,7 +730,7 @@
       QgsDebugMsg( "Database opened -> open select cursor" );
       dbString dbstr;
       db_init_string( &dbstr );
-      db_set_string( &dbstr, (char *)"select * from " );
+      db_set_string( &dbstr, ( char * )"select * from " );
       db_append_string( &dbstr, layer.fieldInfo->table );
 
       QgsDebugMsg( QString( "SQL: %1" ).arg( db_get_string( &dbstr ) ) );
@@ -1074,7 +1074,7 @@
 
   // TODO: Should be done better / in other place ?
   // TODO: Is it necessary for close ?
-  G__setenv( (char *)"MAPSET", map->mapset.toAscii().data() );
+  G__setenv(( char * )"MAPSET", map->mapset.toAscii().data() );
 
   if ( closeMap ) Vect_close( map->map );
 
@@ -1423,7 +1423,7 @@
 
   // Set current mapset (mapset was previously checked by isGrassEditable() )
   // TODO: Should be done better / in other place ?
-  G__setenv( (char *)"MAPSET", map->mapset.toAscii().data() );
+  G__setenv(( char * )"MAPSET", map->mapset.toAscii().data() );
 
   Vect_close( map->map );
 
@@ -1499,7 +1499,7 @@
   // Set current mapset (mapset was previously checked by isGrassEditable() )
   // TODO: Should be done better / in other place ?
   // TODO: Is it necessary for build/close ?
-  G__setenv( (char *) "MAPSET", map->mapset.toAscii().data() );
+  G__setenv(( char * ) "MAPSET", map->mapset.toAscii().data() );
 
   Vect_build_partial( map->map, GV_BUILD_NONE, NULL );
   Vect_build( map->map, stderr );



More information about the QGIS-commit mailing list