Skip to content

Commit

Permalink
fix #3374
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15108 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 30, 2011
1 parent 3cc6f3f commit 0f0a966
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -368,6 +368,15 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature )
// 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 )
Expand Down

0 comments on commit 0f0a966

Please sign in to comment.