Skip to content
Permalink
Browse files

QgsVectorDataProvider::supportedType(): only checks field length and …

…precision against min/max if they are defined (ie > 0). Fixes test_qgsauxiliarystorage.py and qgis_projectstoragetest
  • Loading branch information
rouault committed Jun 1, 2018
1 parent a3e527d commit b9003ffa12b2e96a62a08a9cd710297b934aa164
Showing with 3 additions and 21 deletions.
  1. +3 −21 src/core/qgsvectordataprovider.cpp
@@ -343,16 +343,7 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
if ( field.type() != nativeType.mType )
continue;

if ( field.length() <= 0 )
{
// source length unlimited
if ( nativeType.mMinLen > 0 || nativeType.mMaxLen > 0 )
{
// destination limited
continue;
}
}
else
if ( field.length() > 0 )
{
// source length limited
if ( ( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) ||
@@ -363,18 +354,9 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
}
}

if ( field.precision() <= 0 )
{
// source precision unlimited / n/a
if ( nativeType.mMinPrec > 0 || nativeType.mMaxPrec > 0 )
{
// destination limited
continue;
}
}
else
if ( field.precision() > 0 )
{
// source precision unlimited / n/a
// source precision limited
if ( ( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) ||
( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) )
{

0 comments on commit b9003ff

Please sign in to comment.
You can’t perform that action at this time.