@@ -951,6 +951,12 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
951
951
952
952
const QgsAttributes& attrs = f.attributes ();
953
953
954
+ const char *oldlocale = setlocale ( LC_NUMERIC, NULL );
955
+ if ( oldlocale )
956
+ oldlocale = strdup ( oldlocale );
957
+
958
+ setlocale ( LC_NUMERIC, " C" );
959
+
954
960
// add possible attribute information
955
961
for ( int targetAttributeId = 0 ; targetAttributeId < attrs.count (); ++targetAttributeId )
956
962
{
@@ -1025,6 +1031,9 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
1025
1031
f.setFeatureId ( OGR_F_GetFID ( feature ) );
1026
1032
}
1027
1033
OGR_F_Destroy ( feature );
1034
+
1035
+ setlocale ( LC_NUMERIC, oldlocale );
1036
+
1028
1037
return returnValue;
1029
1038
}
1030
1039
@@ -1155,6 +1164,11 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
1155
1164
1156
1165
const QgsAttributeMap& attr = it.value ();
1157
1166
1167
+ const char *oldlocale = setlocale ( LC_NUMERIC, NULL );
1168
+ if ( oldlocale )
1169
+ oldlocale = strdup ( oldlocale );
1170
+ setlocale ( LC_NUMERIC, " C" );
1171
+
1158
1172
for ( QgsAttributeMap::const_iterator it2 = attr.begin (); it2 != attr.end (); ++it2 )
1159
1173
{
1160
1174
int f = it2.key ();
@@ -1215,6 +1229,8 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
1215
1229
{
1216
1230
pushError ( tr ( " OGR error setting feature %1: %2" ).arg ( fid ).arg ( CPLGetLastErrorMsg () ) );
1217
1231
}
1232
+
1233
+ setlocale ( LC_NUMERIC, oldlocale );
1218
1234
}
1219
1235
1220
1236
if ( OGR_L_SyncToDisk ( ogrLayer ) != OGRERR_NONE )
0 commit comments