Skip to content

Commit e715b91

Browse files
rouaultslarosa
authored andcommittedJul 6, 2018
QgsVectorDataProvider::supportedType(): only checks field length and precision against min/max if they are defined (ie > 0). Fixes test_qgsauxiliarystorage.py and qgis_projectstoragetest
1 parent 00c301e commit e715b91

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed
 

‎src/core/qgsvectordataprovider.cpp

+3-21
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,7 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
309309
if ( field.type() != nativeType.mType )
310310
continue;
311311

312-
if ( field.length() <= 0 )
313-
{
314-
// source length unlimited
315-
if ( nativeType.mMinLen > 0 || nativeType.mMaxLen > 0 )
316-
{
317-
// destination limited
318-
continue;
319-
}
320-
}
321-
else
312+
if ( field.length() > 0 )
322313
{
323314
// source length limited
324315
if ( ( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) ||
@@ -329,18 +320,9 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
329320
}
330321
}
331322

332-
if ( field.precision() <= 0 )
333-
{
334-
// source precision unlimited / n/a
335-
if ( nativeType.mMinPrec > 0 || nativeType.mMaxPrec > 0 )
336-
{
337-
// destination limited
338-
continue;
339-
}
340-
}
341-
else
323+
if ( field.precision() > 0 )
342324
{
343-
// source precision unlimited / n/a
325+
// source precision limited
344326
if ( ( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) ||
345327
( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) )
346328
{

0 commit comments

Comments
 (0)
Please sign in to comment.