[QGIS Commit] r15108 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Jan 30 07:12:03 EST 2011


Author: jef
Date: 2011-01-30 04:12:03 -0800 (Sun, 30 Jan 2011)
New Revision: 15108

Modified:
   trunk/qgis/src/core/qgsvectorfilewriter.cpp
Log:
fix #3374

Modified: trunk/qgis/src/core/qgsvectorfilewriter.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorfilewriter.cpp	2011-01-29 20:39:52 UTC (rev 15107)
+++ trunk/qgis/src/core/qgsvectorfilewriter.cpp	2011-01-30 12:12:03 UTC (rev 15108)
@@ -368,6 +368,15 @@
   // create the feature
   OGRFeatureH poFeature = OGR_F_Create( OGR_L_GetLayerDefn( mLayer ) );
 
+  OGRErr err = OGR_F_SetFID( poFeature, feature.id() );
+  if ( err != OGRERR_NONE )
+  {
+    QgsDebugMsg( QString( "Failed to set feature id to %1: %2 (OGR error: %3)" )
+                 .arg( feature.id() )
+                 .arg( err ).arg( CPLGetLastErrorMsg() )
+               );
+  }
+
   // attribute handling
   QgsFieldMap::const_iterator fldIt;
   for ( fldIt = mFields.begin(); fldIt != mFields.end(); ++fldIt )



More information about the QGIS-commit mailing list