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/qgis@15108 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 30, 2011
1 parent 35c53b3 commit cf14052
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
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 cf14052

Please sign in to comment.