[QGIS Commit] r12404 - trunk/qgis/src/providers/spatialite

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Dec 11 05:25:43 EST 2009


Author: jef
Date: 2009-12-11 05:25:43 -0500 (Fri, 11 Dec 2009)
New Revision: 12404

Modified:
   trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
Log:
fix #2250

Modified: trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
===================================================================
--- trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp	2009-12-10 23:49:36 UTC (rev 12403)
+++ trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp	2009-12-11 10:25:43 UTC (rev 12404)
@@ -225,7 +225,7 @@
     const QString & fieldname = fld.name();
     sql += ", \"";
     sql += fieldname;
-	sql += "\"";
+    sql += "\"";
   }
   if ( fetchGeometry )
   {
@@ -526,7 +526,7 @@
     const QString & fieldname = fld.name();
     sql += ", \"";
     sql += fieldname;
-	sql += "\"";
+    sql += "\"";
   }
   if ( fetchGeometry )
   {
@@ -872,14 +872,12 @@
           uniqueValues.append( QString( "%1" ).arg( sqlite3_column_double( stmt, 0 ) ) );
           break;
         case SQLITE_TEXT:
-          txt = ( const char * ) sqlite3_column_text( stmt, 0 );
-          uniqueValues.append( txt );
+          uniqueValues.append( QString::fromUtf8(( const char * ) sqlite3_column_text( stmt, 0 ) ) );
           break;
         default:
-          txt = "";
-          uniqueValues.append( txt );
+          uniqueValues.append( "" );
           break;
-      };
+      }
     }
     else
     {
@@ -952,7 +950,7 @@
 
     sql += ", \"";
     sql += fieldname;
-	sql += "\"";
+    sql += "\"";
     values += ", ?";
   }
 
@@ -1033,7 +1031,7 @@
     // performing actual row insert
     ret = sqlite3_step( stmt );
 
-	if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
+    if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
     {
       numberFeatures++;
     }
@@ -1254,29 +1252,29 @@
         sql += ",";
       else
         first = false;
-	
-	  QVariant::Type type = siter->type();
-	  if ( siter->toString().isEmpty() )
-	  {
-	  // assuming to be a NULL value
-		type = QVariant::Invalid;
-	  }
 
-	  if ( type == QVariant::Invalid )
-	  {
-	  // binding a NULL value
-		sql += QString( "\"%1\"=NULL" ).arg( fieldName );
-	  }
-	  else if ( type == QVariant::Int || type == QVariant::Double )
-	  {
-	  // binding a NUMERIC value
-		sql += QString( "\"%1\"=%2" ).arg( fieldName ).arg( siter->toString() );
-	  }
-	  else
-	  {
-	  // binding a TEXT value
-		sql += QString( "\"%1\"=%2" ).arg( fieldName ).arg( quotedValue( siter->toString() ) );
-	  }
+      QVariant::Type type = siter->type();
+      if ( siter->toString().isEmpty() )
+      {
+        // assuming to be a NULL value
+        type = QVariant::Invalid;
+      }
+
+      if ( type == QVariant::Invalid )
+      {
+        // binding a NULL value
+        sql += QString( "\"%1\"=NULL" ).arg( fieldName );
+      }
+      else if ( type == QVariant::Int || type == QVariant::Double )
+      {
+        // binding a NUMERIC value
+        sql += QString( "\"%1\"=%2" ).arg( fieldName ).arg( siter->toString() );
+      }
+      else
+      {
+        // binding a TEXT value
+        sql += QString( "\"%1\"=%2" ).arg( fieldName ).arg( quotedValue( siter->toString() ) );
+      }
     }
     sql += QString( " WHERE ROWID=%1" ).arg( fid );
 



More information about the QGIS-commit mailing list