Skip to content

Commit

Permalink
Support writing LongLong types with GDAL 2
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 163894d commit 5133694
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,18 +1757,32 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )

switch ( attrValue.type() )
{
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
case QVariant::Int:
case QVariant::UInt:
OGR_F_SetFieldInteger( poFeature, ogrField, attrValue.toInt() );
break;
case QVariant::Double:
OGR_F_SetFieldDouble( poFeature, ogrField, attrValue.toDouble() );
case QVariant::LongLong:
case QVariant::ULongLong:
OGR_F_SetFieldInteger64( poFeature, ogrField, attrValue.toLongLong() );
break;
case QVariant::String:
OGR_F_SetFieldString( poFeature, ogrField, mCodec->fromUnicode( attrValue.toString() ).data() );
break;
#else
case QVariant::Int:
OGR_F_SetFieldInteger( poFeature, ogrField, attrValue.toInt() );
break;
case QVariant::String:
case QVariant::LongLong:
case QVariant::UInt:
case QVariant::ULongLong:
case QVariant::String:
OGR_F_SetFieldString( poFeature, ogrField, mCodec->fromUnicode( attrValue.toString() ).data() );
break;
#endif
case QVariant::Double:
OGR_F_SetFieldDouble( poFeature, ogrField, attrValue.toDouble() );
break;
case QVariant::Date:
OGR_F_SetFieldDateTime( poFeature, ogrField,
attrValue.toDate().year(),
Expand Down

0 comments on commit 5133694

Please sign in to comment.