Skip to content

Commit b9003ff

Browse files
committedJun 1, 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 a3e527d commit b9003ff

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed
 

‎src/core/qgsvectordataprovider.cpp

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,7 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
343343
if ( field.type() != nativeType.mType )
344344
continue;
345345

346-
if ( field.length() <= 0 )
347-
{
348-
// source length unlimited
349-
if ( nativeType.mMinLen > 0 || nativeType.mMaxLen > 0 )
350-
{
351-
// destination limited
352-
continue;
353-
}
354-
}
355-
else
346+
if ( field.length() > 0 )
356347
{
357348
// source length limited
358349
if ( ( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) ||
@@ -363,18 +354,9 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
363354
}
364355
}
365356

366-
if ( field.precision() <= 0 )
367-
{
368-
// source precision unlimited / n/a
369-
if ( nativeType.mMinPrec > 0 || nativeType.mMaxPrec > 0 )
370-
{
371-
// destination limited
372-
continue;
373-
}
374-
}
375-
else
357+
if ( field.precision() > 0 )
376358
{
377-
// source precision unlimited / n/a
359+
// source precision limited
378360
if ( ( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) ||
379361
( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) )
380362
{

0 commit comments

Comments
 (0)
Please sign in to comment.