File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1757,18 +1757,32 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
1757
1757
1758
1758
switch ( attrValue.type () )
1759
1759
{
1760
+ #if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
1760
1761
case QVariant::Int:
1762
+ case QVariant::UInt:
1761
1763
OGR_F_SetFieldInteger ( poFeature, ogrField, attrValue.toInt () );
1762
1764
break ;
1763
- case QVariant::Double:
1764
- OGR_F_SetFieldDouble ( poFeature, ogrField, attrValue.toDouble () );
1765
+ case QVariant::LongLong:
1766
+ case QVariant::ULongLong:
1767
+ OGR_F_SetFieldInteger64 ( poFeature, ogrField, attrValue.toLongLong () );
1768
+ break ;
1769
+ case QVariant::String:
1770
+ OGR_F_SetFieldString ( poFeature, ogrField, mCodec ->fromUnicode ( attrValue.toString () ).data () );
1771
+ break ;
1772
+ #else
1773
+ case QVariant::Int:
1774
+ OGR_F_SetFieldInteger ( poFeature, ogrField, attrValue.toInt () );
1765
1775
break ;
1776
+ case QVariant::String:
1766
1777
case QVariant::LongLong:
1767
1778
case QVariant::UInt:
1768
1779
case QVariant::ULongLong:
1769
- case QVariant::String:
1770
1780
OGR_F_SetFieldString ( poFeature, ogrField, mCodec ->fromUnicode ( attrValue.toString () ).data () );
1771
1781
break ;
1782
+ #endif
1783
+ case QVariant::Double:
1784
+ OGR_F_SetFieldDouble ( poFeature, ogrField, attrValue.toDouble () );
1785
+ break ;
1772
1786
case QVariant::Date:
1773
1787
OGR_F_SetFieldDateTime ( poFeature, ogrField,
1774
1788
attrValue.toDate ().year (),
You can’t perform that action at this time.
0 commit comments