Skip to content
Permalink
Browse files

fix spatialite provider (fixes #1883 & 1884)

git-svn-id: http://svn.osgeo.org/qgis/trunk@11438 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Aug 19, 2009
1 parent d2803b6 commit 52c420b03f95dee615cfa7f0f0f9d90f64db7872
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -269,7 +269,7 @@ bool QgsSpatiaLiteProvider::featureAtId( int featureId, QgsFeature & feature, bo
// iterate attributes
bool fetched = false;
int nAttr = 1;
for ( QgsAttributeList::const_iterator it = mAttributesToFetch.constBegin(); it != mAttributesToFetch.constEnd(); it++ )
for ( QgsAttributeList::const_iterator it = fetchAttributes.constBegin(); it != fetchAttributes.constEnd(); it++ )
{
if ( nAttr == ic )
{
@@ -952,7 +952,7 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
{
// binding a TEXT value
QString txt = it->toString();
int len = txt.length();
int len = txt.toUtf8().length() + 1;
char *vl = new char [len];
strcpy( vl, txt.toUtf8().constData() );
sqlite3_bind_text( stmt, ++ia, vl, len, SQLITE_TRANSIENT );
@@ -967,8 +967,11 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )

// performing actual row insert
ret = sqlite3_step( stmt );

if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
;
{
numberFeatures++;
}
else
{
// some unexpected error occurred
@@ -1054,7 +1057,9 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds & id )
// performing actual row deletion
ret = sqlite3_step( stmt );
if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
;
{
numberFeatures--;
}
else
{
// some unexpected error occurred

0 comments on commit 52c420b

Please sign in to comment.
You can’t perform that action at this time.