@@ -297,22 +297,22 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
297
297
QVariant::typeToName ( field.type () ) )
298
298
.arg ( field.length () )
299
299
.arg ( field.precision () ), 2 );
300
- for ( i = 0 ; i < mNativeTypes . size (); i++ )
300
+ Q_FOREACH ( const NativeType &nativeType, mNativeTypes )
301
301
{
302
302
QgsDebugMsgLevel ( QString ( " native field type = %1 min length = %2 max length = %3 min precision = %4 max precision = %5" )
303
- .arg ( QVariant::typeToName ( mNativeTypes [i] .mType ) )
304
- .arg ( mNativeTypes [i] .mMinLen )
305
- .arg ( mNativeTypes [i] .mMaxLen )
306
- .arg ( mNativeTypes [i] .mMinPrec )
307
- .arg ( mNativeTypes [i] .mMaxPrec ), 2 );
303
+ .arg ( QVariant::typeToName ( nativeType .mType ) )
304
+ .arg ( nativeType .mMinLen )
305
+ .arg ( nativeType .mMaxLen )
306
+ .arg ( nativeType .mMinPrec )
307
+ .arg ( nativeType .mMaxPrec ), 2 );
308
308
309
- if ( field.type () != mNativeTypes [i] .mType )
309
+ if ( field.type () != nativeType .mType )
310
310
continue ;
311
311
312
312
if ( field.length () == -1 )
313
313
{
314
314
// source length unlimited
315
- if ( mNativeTypes [i] .mMinLen > -1 || mNativeTypes [i] .mMaxLen > -1 )
315
+ if ( nativeType .mMinLen > -1 || nativeType .mMaxLen > -1 )
316
316
{
317
317
// destination limited
318
318
continue ;
@@ -321,8 +321,8 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
321
321
else
322
322
{
323
323
// source length limited
324
- if ( mNativeTypes [i] .mMinLen > -1 && mNativeTypes [i] .mMaxLen > -1 &&
325
- ( field.length () < mNativeTypes [i] .mMinLen || field.length () > mNativeTypes [i] .mMaxLen ) )
324
+ if ( nativeType .mMinLen > -1 && nativeType .mMaxLen > -1 &&
325
+ ( field.length () < nativeType .mMinLen || field.length () > nativeType .mMaxLen ) )
326
326
{
327
327
// source length exceeds destination limits
328
328
continue ;
@@ -332,7 +332,7 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
332
332
if ( field.precision () == -1 )
333
333
{
334
334
// source precision unlimited / n/a
335
- if ( mNativeTypes [i] .mMinPrec > -1 || mNativeTypes [i] .mMaxPrec > -1 )
335
+ if ( nativeType .mMinPrec > -1 || nativeType .mMaxPrec > -1 )
336
336
{
337
337
// destination limited
338
338
continue ;
@@ -341,8 +341,8 @@ bool QgsVectorDataProvider::supportedType( const QgsField &field ) const
341
341
else
342
342
{
343
343
// source precision unlimited / n/a
344
- if ( mNativeTypes [i] .mMinPrec > -1 && mNativeTypes [i] .mMaxPrec > -1 &&
345
- ( field.precision () < mNativeTypes [i] .mMinPrec || field.precision () > mNativeTypes [i] .mMaxPrec ) )
344
+ if ( nativeType .mMinPrec > -1 && nativeType .mMaxPrec > -1 &&
345
+ ( field.precision () < nativeType .mMinPrec || field.precision () > nativeType .mMaxPrec ) )
346
346
{
347
347
// source precision exceeds destination limits
348
348
continue ;
0 commit comments