|
@@ -343,10 +343,10 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const |
|
|
if ( field.type() != nativeType.mType ) |
|
|
continue; |
|
|
|
|
|
if ( field.length() == -1 ) |
|
|
if ( field.length() <= 0 ) |
|
|
{ |
|
|
// source length unlimited |
|
|
if ( nativeType.mMinLen > -1 || nativeType.mMaxLen > -1 ) |
|
|
if ( nativeType.mMinLen > 0 || nativeType.mMaxLen > 0 ) |
|
|
{ |
|
|
// destination limited |
|
|
continue; |
|
@@ -355,18 +355,18 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const |
|
|
else |
|
|
{ |
|
|
// source length limited |
|
|
if ( nativeType.mMinLen > -1 && nativeType.mMaxLen > -1 && |
|
|
( field.length() < nativeType.mMinLen || field.length() > nativeType.mMaxLen ) ) |
|
|
if ( ( nativeType.mMinLen > 0 && field.length() < nativeType.mMinLen ) || |
|
|
( nativeType.mMaxLen > 0 && field.length() > nativeType.mMaxLen ) ) |
|
|
{ |
|
|
// source length exceeds destination limits |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
if ( field.precision() == -1 ) |
|
|
if ( field.precision() <= 0 ) |
|
|
{ |
|
|
// source precision unlimited / n/a |
|
|
if ( nativeType.mMinPrec > -1 || nativeType.mMaxPrec > -1 ) |
|
|
if ( nativeType.mMinPrec > 0 || nativeType.mMaxPrec > 0 ) |
|
|
{ |
|
|
// destination limited |
|
|
continue; |
|
@@ -375,8 +375,8 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const |
|
|
else |
|
|
{ |
|
|
// source precision unlimited / n/a |
|
|
if ( nativeType.mMinPrec > -1 && nativeType.mMaxPrec > -1 && |
|
|
( field.precision() < nativeType.mMinPrec || field.precision() > nativeType.mMaxPrec ) ) |
|
|
if ( ( nativeType.mMinPrec > 0 && field.precision() < nativeType.mMinPrec ) || |
|
|
( nativeType.mMaxPrec > 0 && field.precision() > nativeType.mMaxPrec ) ) |
|
|
{ |
|
|
// source precision exceeds destination limits |
|
|
continue; |
|
|