Skip to content

Commit ae2738e

Browse files
committed
[ogr] Update for GDAL 2 handle 64bit integers in add feature
1 parent 80c9d02 commit ae2738e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/providers/ogr/qgsogrprovider.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,13 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
987987
OGR_F_SetFieldInteger( feature, targetAttributeId, attrVal.toInt() );
988988
break;
989989

990+
991+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
992+
case OFTInteger64:
993+
OGR_F_SetFieldInteger64( feature, targetAttributeId, attrVal.toLongLong() );
994+
break;
995+
#endif
996+
990997
case OFTReal:
991998
OGR_F_SetFieldDouble( feature, targetAttributeId, attrVal.toDouble() );
992999
break;
@@ -1204,6 +1211,11 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_
12041211
case OFTInteger:
12051212
OGR_F_SetFieldInteger( of, f, it2->toInt() );
12061213
break;
1214+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
1215+
case OFTInteger64:
1216+
OGR_F_SetFieldInteger64( of, f, it2->toLongLong() );
1217+
break;
1218+
#endif
12071219
case OFTReal:
12081220
OGR_F_SetFieldDouble( of, f, it2->toDouble() );
12091221
break;

0 commit comments

Comments
 (0)