[QGIS Commit] r9448 - in trunk/qgis: src/app src/core src/core/composer src/core/raster src/core/renderer tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Oct 6 17:16:32 EDT 2008


Author: jef
Date: 2008-10-06 17:16:31 -0400 (Mon, 06 Oct 2008)
New Revision: 9448

Modified:
   trunk/qgis/src/app/qgsoptions.cpp
   trunk/qgis/src/core/composer/qgslegendmodel.cpp
   trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
   trunk/qgis/src/core/qgsmaplayer.cpp
   trunk/qgis/src/core/qgsmaplayer.h
   trunk/qgis/src/core/qgsprojectfiletransform.cpp
   trunk/qgis/src/core/qgsvectordataprovider.cpp
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/qgsvectorlayer.h
   trunk/qgis/src/core/raster/qgsrasterlayer.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.h
   trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
   trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.h
   trunk/qgis/src/core/renderer/qgsrenderer.h
   trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.h
   trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
   trunk/qgis/tests/src/core/testqgsrenderers.cpp
Log:
automatic indentation update (r9365-r9447)

Modified: trunk/qgis/src/app/qgsoptions.cpp
===================================================================
--- trunk/qgis/src/app/qgsoptions.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/app/qgsoptions.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -168,7 +168,7 @@
   mDefaultSnapModeComboBox->insertItem( 0, tr( "to vertex" ), "to vertex" );
   mDefaultSnapModeComboBox->insertItem( 1, tr( "to segment" ), "to segment" );
   mDefaultSnapModeComboBox->insertItem( 2, tr( "to vertex and segment" ), "to vertex and segment" );
-  QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "to vertex").toString();
+  QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "to vertex" ).toString();
   mDefaultSnapModeComboBox->setCurrentIndex( mDefaultSnapModeComboBox->findData( defaultSnapString ) );
   mDefaultSnappingToleranceSpinBox->setValue( settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble() );
   mSearchRadiusVertexEditSpinBox->setValue( settings.value( "/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble() );

Modified: trunk/qgis/src/core/composer/qgslegendmodel.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgslegendmodel.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/composer/qgslegendmodel.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -434,10 +434,10 @@
   label = s->label();
 
   //Take the label as item text if it is there
-  if(!label.isEmpty())
-    {
-      itemText = label;
-    }
+  if ( !label.isEmpty() )
+  {
+    itemText = label;
+  }
   //take single value
   else if ( lowerValue == upperValue || upperValue.isEmpty() )
   {

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -45,16 +45,16 @@
 
 QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem()
     : mMapUnits( QGis::UNKNOWN ),
-      mIsValidFlag( 0 ),
-      mValidationHint ( 0 )
+    mIsValidFlag( 0 ),
+    mValidationHint( 0 )
 {
   mCRS = OSRNewSpatialReference( NULL );
 }
 
 QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( QString theWkt )
     : mMapUnits( QGis::UNKNOWN ),
-      mIsValidFlag( 0 ),
-      mValidationHint ( 0 )
+    mIsValidFlag( 0 ),
+    mValidationHint( 0 )
 {
   mCRS = OSRNewSpatialReference( NULL );
   createFromWkt( theWkt );
@@ -63,8 +63,8 @@
 
 QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType )
     : mMapUnits( QGis::UNKNOWN ),
-      mIsValidFlag( 0 ),
-      mValidationHint ( 0 )
+    mIsValidFlag( 0 ),
+    mValidationHint( 0 )
 {
   mCRS = OSRNewSpatialReference( NULL );
   createFromId( theId, theType );

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -536,14 +536,14 @@
   }
 
   QString errorMsg;
-  theResultFlag = readSymbology(myRoot, errorMsg);
-  if(!theResultFlag)
-    {
-      myErrorMessage = QObject::tr( "Loading style file " ) + theURI + QObject::tr(" failed because:") + "\n" + errorMsg;
-      return myErrorMessage;
-    }
+  theResultFlag = readSymbology( myRoot, errorMsg );
+  if ( !theResultFlag )
+  {
+    myErrorMessage = QObject::tr( "Loading style file " ) + theURI + QObject::tr( " failed because:" ) + "\n" + errorMsg;
+    return myErrorMessage;
+  }
 
-  return ""; 
+  return "";
 }
 
 QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
@@ -565,10 +565,10 @@
   myDocument.appendChild( myRootNode );
 
   QString errorMsg;
-  if(!writeSymbology(myRootNode, myDocument, errorMsg))
-    {
-      return QObject::tr("Could not save symbology because:") + "\n" + errorMsg;
-    }
+  if ( !writeSymbology( myRootNode, myDocument, errorMsg ) )
+  {
+    return QObject::tr( "Could not save symbology because:" ) + "\n" + errorMsg;
+  }
 
   // check if the uri is a file or ends with .qml,
   // which indicates that it should become one

Modified: trunk/qgis/src/core/qgsmaplayer.h
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsmaplayer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -244,12 +244,12 @@
      */
     virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );
 
-    /** Read the symbology for the current layer from the Dom node supplied. 
+    /** Read the symbology for the current layer from the Dom node supplied.
      * @param QDomNode node that will contain the symbology definition for this layer.
      * @param errorMessage reference to string that will be updated with any error messages
      * @return true in case of success.
     */
-    virtual bool readSymbology(const QDomNode& node, QString& errorMessage) = 0;
+    virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0;
 
     /** Write the symbology for the layer into the docment provided.
      *  @param QDomNode the node that will have the style element added to it.
@@ -257,7 +257,7 @@
      * @param errorMessage reference to string that will be updated with any error messages
      *  @return true in case of success.
      */
-    virtual bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const = 0;
+    virtual bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const = 0;
 
   public slots:
 

Modified: trunk/qgis/src/core/qgsprojectfiletransform.cpp
===================================================================
--- trunk/qgis/src/core/qgsprojectfiletransform.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsprojectfiletransform.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -38,7 +38,7 @@
   {PFV( 0, 9, 1 ), PFV( 0, 10, 0 ), &QgsProjectFileTransform::transform091to0100},
   {PFV( 0, 9, 2 ), PFV( 0, 10, 0 ), &QgsProjectFileTransform::transformNull},
   {PFV( 0, 10, 0 ), PFV( 0, 11, 0 ), &QgsProjectFileTransform::transform0100to0110},
-  {PFV( 0, 11, 0 ), PFV( 1, 0, 0), &QgsProjectFileTransform::transform0110to1000}
+  {PFV( 0, 11, 0 ), PFV( 1, 0, 0 ), &QgsProjectFileTransform::transform0110to1000}
 };
 
 bool QgsProjectFileTransform::updateRevision( QgsProjectVersion newVersion )
@@ -287,62 +287,62 @@
 {
   if ( ! mDom.isNull() )
   {
-    QDomNodeList layerList = mDom.elementsByTagName("maplayer");
-    for(int i = 0; i < layerList.size(); ++i)
+    QDomNodeList layerList = mDom.elementsByTagName( "maplayer" );
+    for ( int i = 0; i < layerList.size(); ++i )
+    {
+      QDomElement layerElem = layerList.at( i ).toElement();
+      QString typeString = layerElem.attribute( "type" );
+      if ( typeString != "vector" )
       {
-	QDomElement layerElem = layerList.at(i).toElement();
-	QString typeString = layerElem.attribute("type");
-	if(typeString != "vector")
-	  {
-	    continue;
-	  }
-	
-	//datasource 
-	QDomNode dataSourceNode = layerElem.namedItem("datasource");
-	if(dataSourceNode.isNull())
-	  {
-	    return;
-	  }
-	QString dataSource = dataSourceNode.toElement().text();
+        continue;
+      }
 
-	//provider key
-	QDomNode providerNode = layerElem.namedItem("provider");
-	if(providerNode.isNull())
-	  {
-	    return;
-	  }
-	QString providerKey = providerNode.toElement().text();
+      //datasource
+      QDomNode dataSourceNode = layerElem.namedItem( "datasource" );
+      if ( dataSourceNode.isNull() )
+      {
+        return;
+      }
+      QString dataSource = dataSourceNode.toElement().text();
 
-	//create the layer to get the provider for int->fieldName conversion
-	QgsVectorLayer* theLayer = new QgsVectorLayer(dataSource, "", providerKey, false);
-	if(!theLayer->isValid())
-	  {
-	    delete theLayer;
-	    return;
-	  }
+      //provider key
+      QDomNode providerNode = layerElem.namedItem( "provider" );
+      if ( providerNode.isNull() )
+      {
+        return;
+      }
+      QString providerKey = providerNode.toElement().text();
 
-	QgsVectorDataProvider* theProvider = theLayer->dataProvider();
-	if(!theProvider)
-	  {
-	    return;
-	  }
-	QgsFieldMap theFieldMap = theProvider->fields();
+      //create the layer to get the provider for int->fieldName conversion
+      QgsVectorLayer* theLayer = new QgsVectorLayer( dataSource, "", providerKey, false );
+      if ( !theLayer->isValid() )
+      {
+        delete theLayer;
+        return;
+      }
 
-	//read classificationfield
-	QDomNodeList classificationFieldList = layerElem.elementsByTagName("classificationfield");
-	for(int j = 0; j < classificationFieldList.size(); ++j)
-	  {
-	    QDomElement classificationFieldElem = classificationFieldList.at(j).toElement();
-	    int fieldNumber = classificationFieldElem.text().toInt();
-	    QgsFieldMap::const_iterator field_it = theFieldMap.find(fieldNumber);
-	    if(field_it != theFieldMap.constEnd())
-	      {
-		QDomText fieldName = mDom.createTextNode(field_it.value().name());
-		QDomNode nameNode = classificationFieldElem.firstChild();
-		classificationFieldElem.replaceChild(fieldName, nameNode);
-	      }
-	  }
-	
+      QgsVectorDataProvider* theProvider = theLayer->dataProvider();
+      if ( !theProvider )
+      {
+        return;
       }
+      QgsFieldMap theFieldMap = theProvider->fields();
+
+      //read classificationfield
+      QDomNodeList classificationFieldList = layerElem.elementsByTagName( "classificationfield" );
+      for ( int j = 0; j < classificationFieldList.size(); ++j )
+      {
+        QDomElement classificationFieldElem = classificationFieldList.at( j ).toElement();
+        int fieldNumber = classificationFieldElem.text().toInt();
+        QgsFieldMap::const_iterator field_it = theFieldMap.find( fieldNumber );
+        if ( field_it != theFieldMap.constEnd() )
+        {
+          QDomText fieldName = mDom.createTextNode( field_it.value().name() );
+          QDomNode nameNode = classificationFieldElem.firstChild();
+          classificationFieldElem.replaceChild( fieldName, nameNode );
+        }
+      }
+
+    }
   }
 }

Modified: trunk/qgis/src/core/qgsvectordataprovider.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectordataprovider.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsvectordataprovider.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -238,10 +238,10 @@
 
   const QgsFieldMap& theFields = fields();
   QgsFieldMap::const_iterator field_it = theFields.constBegin();
-  for(; field_it != theFields.constEnd(); ++field_it)
-    {
-      resultMap.insert(field_it.value().name(), field_it.key());
-    }
+  for ( ; field_it != theFields.constEnd(); ++field_it )
+  {
+    resultMap.insert( field_it.value().name(), field_it.key() );
+  }
 
   return resultMap;
 }

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -2085,10 +2085,10 @@
   }
 
   QString errorMsg;
-  if(!readSymbology(layer_node, errorMsg))
-    {
-      return false;
-    }
+  if ( !readSymbology( layer_node, errorMsg ) )
+  {
+    return false;
+  }
 
   // Test if labeling is on or off
   QDomNode labelnode = layer_node.namedItem( "label" );
@@ -2319,10 +2319,10 @@
   // renderer specific settings
 
   QString errorMsg;
-  if(!writeSymbology( layer_node, document, errorMsg ))
-    {
-      return false;
-    }
+  if ( !writeSymbology( layer_node, document, errorMsg ) )
+  {
+    return false;
+  }
 
   // Now we get to do all that all over again for QgsLabel
 
@@ -2396,7 +2396,7 @@
   return true;
 } // bool QgsVectorLayer::writeXml
 
-bool QgsVectorLayer::readSymbology(const QDomNode& node, QString& errorMessage)
+bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage )
 {
   // create and bind a renderer to this layer
 
@@ -2428,34 +2428,34 @@
     renderer = new QgsUniqueValueRenderer( vectorType() );
     returnCode = renderer->readXML( uniquevaluenode, *this );
   }
-  
-  if(!renderer)
-    {
-      return false;
-    }
 
-  if(returnCode == 1)
-    {
-      errorMessage = tr("No renderer object"); delete renderer; return false;
-    }
-  else if(returnCode == 2)
-    {
-      errorMessage = tr("Classification field not found"); delete renderer; return false;
-    }
+  if ( !renderer )
+  {
+    return false;
+  }
 
+  if ( returnCode == 1 )
+  {
+    errorMessage = tr( "No renderer object" ); delete renderer; return false;
+  }
+  else if ( returnCode == 2 )
+  {
+    errorMessage = tr( "Classification field not found" ); delete renderer; return false;
+  }
+
   mRenderer = renderer;
   return true;
 }
 
-bool QgsVectorLayer::writeSymbology(QDomNode& node, QDomDocument& doc, QString& errorMessage) const
+bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const
 {
   const QgsRenderer * myRenderer = renderer();
   if ( myRenderer )
   {
-    if(!myRenderer->writeXML( node, doc, *this ))
-      {
-	return false;
-      }
+    if ( !myRenderer->writeXML( node, doc, *this ) )
+    {
+      return false;
+    }
   }
   else
   {

Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/qgsvectorlayer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -173,12 +173,12 @@
      */
     virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
 
-     /** Read the symbology for the current layer from the Dom node supplied. 
-     * @param QDomNode node that will contain the symbology definition for this layer.
-     * @param errorMessage reference to string that will be updated with any error messages
-     * @return true in case of success.
+    /** Read the symbology for the current layer from the Dom node supplied.
+    * @param QDomNode node that will contain the symbology definition for this layer.
+    * @param errorMessage reference to string that will be updated with any error messages
+    * @return true in case of success.
     */
-    bool readSymbology(const QDomNode& node, QString& errorMessage);
+    bool readSymbology( const QDomNode& node, QString& errorMessage );
 
     /** Write the symbology for the layer into the docment provided.
      *  @param QDomNode the node that will have the style element added to it.
@@ -186,7 +186,7 @@
      * @param errorMessage reference to string that will be updated with any error messages
      *  @return true in case of success.
      */
-    bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const;
+    bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const;
 
 
     /**

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -3871,11 +3871,11 @@
     }
 
   }
- 
+
   QString theError;
-  return readSymbology(layer_node, theError);
-  
+  return readSymbology( layer_node, theError );
 
+
 } // QgsRasterLayer::readXml( QDomNode & layer_node )
 
 
@@ -3902,13 +3902,13 @@
   QDomText providerText = document.createTextNode( mProviderKey );
   provider.appendChild( providerText );
   layer_node.appendChild( provider );
-  
+
   //write out the symbology
   QString errorMsg;
-  return writeSymbology ( layer_node, document, errorMsg );
+  return writeSymbology( layer_node, document, errorMsg );
 }
 
-bool QgsRasterLayer::writeSymbology ( QDomNode & layer_node, QDomDocument & document, QString& errorMessage) const
+bool QgsRasterLayer::writeSymbology( QDomNode & layer_node, QDomDocument & document, QString& errorMessage ) const
 {
   // <rasterproperties>
   QDomElement rasterPropertiesElement = document.createElement( "rasterproperties" );
@@ -4236,7 +4236,7 @@
   return true;
 } // bool QgsRasterLayer::writeSymbology
 
-bool QgsRasterLayer::readSymbology(const QDomNode& layer_node, QString& errorMessage)
+bool QgsRasterLayer::readSymbology( const QDomNode& layer_node, QString& errorMessage )
 {
   QDomNode mnl = layer_node.namedItem( "rasterproperties" );
   QDomNode snode = mnl.namedItem( "drawingStyle" );
@@ -4393,7 +4393,7 @@
     QDomNode customColorRampTypeNode = customColorRampNode.namedItem( "customColorRampType" );
     QDomNode colorRampTypeNode = customColorRampNode.namedItem( "colorRampType" );
     QString myRampType = "";
-    if( "" == customColorRampTypeNode.toElement().text() )
+    if ( "" == customColorRampTypeNode.toElement().text() )
     {
       myRampType = colorRampTypeNode.toElement().text();
     }
@@ -4424,7 +4424,7 @@
     }
     myColorRampShader->setColorRampItemList( myColorRampItemList );
   }
-  return true; 
+  return true;
 } //readSymbology
 
 bool QgsRasterLayer::identify( const QgsPoint& point, QMap<QString, QString>& results )
@@ -4434,7 +4434,7 @@
   {
     return false;
   }
-  
+
   double x = point.x();
   double y = point.y();
 

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -894,12 +894,12 @@
     */
     /* virtual */ bool writeXml( QDomNode & layer_node, QDomDocument & doc );
 
-     /** Read the symbology for the current layer from the Dom node supplied. 
-     * @param QDomNode node that will contain the symbology definition for this layer.
-     * @param errorMessage reference to string that will be updated with any error messages
-     * @return true in case of success.
+    /** Read the symbology for the current layer from the Dom node supplied.
+    * @param QDomNode node that will contain the symbology definition for this layer.
+    * @param errorMessage reference to string that will be updated with any error messages
+    * @return true in case of success.
     */
-    bool readSymbology(const QDomNode& node, QString& errorMessage);
+    bool readSymbology( const QDomNode& node, QString& errorMessage );
 
     /** Write the symbology for the layer into the docment provided.
      *  @param QDomNode the node that will have the style element added to it.
@@ -907,7 +907,7 @@
      * @param errorMessage reference to string that will be updated with any error messages
      *  @return true in case of success.
      */
-    bool writeSymbology(QDomNode&, QDomDocument& doc, QString& errorMessage) const;
+    bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const;
 
   private:
 

Modified: trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -187,16 +187,16 @@
   QString classificationField = classnode.toElement().text();
 
   QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return 1;
-    }
-  int classificationId = theProvider->fieldNameIndex(classificationField);
-  if(classificationId == -1)
-    {
-      return 2; //@todo: handle gracefully in gui situation where user needs to nominate field 
-    }
-  this->setClassificationField(classificationId);
+  if ( !theProvider )
+  {
+    return 1;
+  }
+  int classificationId = theProvider->fieldNameIndex( classificationField );
+  if ( classificationId == -1 )
+  {
+    return 2; //@todo: handle gracefully in gui situation where user needs to nominate field
+  }
+  this->setClassificationField( classificationId );
 
   //polygon outline
   QDomNode polyoutlinenode = rnode.namedItem( "polygonoutline" );
@@ -246,17 +246,17 @@
 bool QgsContinuousColorRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const
 {
   const QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return false;
-    }
+  if ( !theProvider )
+  {
+    return false;
+  }
 
   QString classificationFieldName;
-  QgsFieldMap::const_iterator field_it = theProvider->fields().find(mClassificationField);
-  if(field_it != theProvider->fields().constEnd())
-    {
-      classificationFieldName = field_it.value().name();
-    }
+  QgsFieldMap::const_iterator field_it = theProvider->fields().find( mClassificationField );
+  if ( field_it != theProvider->fields().constEnd() )
+  {
+    classificationFieldName = field_it.value().name();
+  }
   bool returnval = true;
 #ifndef WIN32
   QDomElement continuoussymbol = document.createElement( "continuoussymbol" );

Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -198,16 +198,16 @@
   QString classificationField = classnode.toElement().text();
 
   QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return 1;
-    }
-  int classificationId = theProvider->fieldNameIndex(classificationField);
-  if(classificationId == -1)
-    {
-      return 2; //@todo: handle gracefully in gui situation where user needs to nominate field 
-    }
-  this->setClassificationField(classificationId);
+  if ( !theProvider )
+  {
+    return 1;
+  }
+  int classificationId = theProvider->fieldNameIndex( classificationField );
+  if ( classificationId == -1 )
+  {
+    return 2; //@todo: handle gracefully in gui situation where user needs to nominate field
+  }
+  this->setClassificationField( classificationId );
 
   QDomNode symbolnode = rnode.namedItem( "symbol" );
   while ( !symbolnode.isNull() )
@@ -261,7 +261,7 @@
   return "Graduated Symbol";
 }
 
-bool QgsGraduatedSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl) const
+bool QgsGraduatedSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const
 {
   bool returnval = true;
   QDomElement graduatedsymbol = document.createElement( "graduatedsymbol" );
@@ -269,20 +269,20 @@
   QDomElement classificationfield = document.createElement( "classificationfield" );
 
   const QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return false;
-    }
+  if ( !theProvider )
+  {
+    return false;
+  }
 
   QString classificationFieldName;
-  QgsFieldMap::const_iterator field_it = theProvider->fields().find(mClassificationField);
-  if(field_it != theProvider->fields().constEnd())
-    {
-      classificationFieldName = field_it.value().name();
-    }
+  QgsFieldMap::const_iterator field_it = theProvider->fields().find( mClassificationField );
+  if ( field_it != theProvider->fields().constEnd() )
+  {
+    classificationFieldName = field_it.value().name();
+  }
 
 
-  QDomText classificationfieldtxt = document.createTextNode(classificationFieldName);
+  QDomText classificationfieldtxt = document.createTextNode( classificationFieldName );
   classificationfield.appendChild( classificationfieldtxt );
   graduatedsymbol.appendChild( classificationfield );
   for ( QList<QgsSymbol*>::const_iterator it = mSymbols.begin(); it != mSymbols.end(); ++it )

Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.h
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -48,7 +48,7 @@
     void renderFeature( QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0 );
     /**Sets the classicifation field by index
     \param field the number of the field to classify*/
-    void setClassificationField(int);
+    void setClassificationField( int );
     /**Reads the renderer configuration from an XML file
      @param rnode the Dom node to read
      @param vl the vector layer which will be associated with the renderer
@@ -57,7 +57,7 @@
     virtual int readXML( const QDomNode& rnode, QgsVectorLayer& vl );
     /**Writes the contents of the renderer to a configuration file
      @ return true in case of success*/
-    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl) const;
+    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const;
     /** Returns true*/
     bool needsAttributes() const;
     /**Returns a list of all needed attributes*/
@@ -90,7 +90,7 @@
   return mClassificationField;
 }
 
-inline void QgsGraduatedSymbolRenderer::setClassificationField(int index)
+inline void QgsGraduatedSymbolRenderer::setClassificationField( int index )
 {
   mClassificationField = index;
 }

Modified: trunk/qgis/src/core/renderer/qgsrenderer.h
===================================================================
--- trunk/qgis/src/core/renderer/qgsrenderer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgsrenderer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -69,7 +69,7 @@
     // virtual void writeXML(std::ostream& xml)=0;
     /**Writes the contents of the renderer to a configuration file
      @ return true in case of success*/
-    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl) const = 0;
+    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const = 0;
     /** Returns true, if attribute values are used by the renderer and false otherwise*/
     virtual bool needsAttributes() const = 0;
     /**Returns a list with indexes of classification attributes*/

Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -177,7 +177,7 @@
   return 0;
 }
 
-bool QgsSingleSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl) const
+bool QgsSingleSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const
 {
   bool returnval = false;
   QDomElement singlesymbol = document.createElement( "singlesymbol" );

Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.h
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.h	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.h	2008-10-06 21:16:31 UTC (rev 9448)
@@ -46,7 +46,7 @@
     /*virtual void writeXML(std::ostream& xml);*/
     /**Writes the contents of the renderer to a configuration file
      @ return true in case of success*/
-    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl) const;
+    virtual bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const;
     /**Returns true, attributes needed for single symbol*/
     bool needsAttributes() const;
     /**Returns a list of all needed attributes*/

Modified: trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -199,16 +199,16 @@
   QString classificationField = classnode.toElement().text();
 
   QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return 1;
-    }
+  if ( !theProvider )
+  {
+    return 1;
+  }
 
-  int classificationId = theProvider->fieldNameIndex(classificationField);
-  if(classificationId == -1)
-    {
-      return 2; //@todo: handle gracefully in gui situation where user needs to nominate field 
-    }
+  int classificationId = theProvider->fieldNameIndex( classificationField );
+  if ( classificationId == -1 )
+  {
+    return 2; //@todo: handle gracefully in gui situation where user needs to nominate field
+  }
   this->setClassificationField( classificationId );
 
   QDomNode symbolnode = rnode.namedItem( "symbol" );
@@ -274,17 +274,17 @@
 bool QgsUniqueValueRenderer::writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const
 {
   const QgsVectorDataProvider* theProvider = vl.dataProvider();
-  if(!theProvider)
-    {
-      return false;
-    }
+  if ( !theProvider )
+  {
+    return false;
+  }
 
   QString classificationFieldName;
-  QgsFieldMap::const_iterator field_it = theProvider->fields().find(mClassificationField);
-  if(field_it != theProvider->fields().constEnd())
-    {
-      classificationFieldName = field_it.value().name();
-    }
+  QgsFieldMap::const_iterator field_it = theProvider->fields().find( mClassificationField );
+  if ( field_it != theProvider->fields().constEnd() )
+  {
+    classificationFieldName = field_it.value().name();
+  }
 
   bool returnval = true;
   QDomElement uniquevalue = document.createElement( "uniquevalue" );

Modified: trunk/qgis/tests/src/core/testqgsrenderers.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsrenderers.cpp	2008-10-06 21:11:54 UTC (rev 9447)
+++ trunk/qgis/tests/src/core/testqgsrenderers.cpp	2008-10-06 21:16:31 UTC (rev 9448)
@@ -169,7 +169,7 @@
 {
   mReport += "<h2>Classification field mismatch test</h2>\n";
   // Here we test to see that a qml created for one layer
-  // will raise an error properly if the 
+  // will raise an error properly if the
   // We will do this by trying to apply the points qml to the polys shpfile
   // it should fail and raise an error
   QString myFileName = mTestDataDir + "points_continuous_symbol.qml";



More information about the QGIS-commit mailing list