Skip to content
Permalink
Browse files
Update QgsFields nameToIndex hash on field removed
  • Loading branch information
arnaud-morvan authored and m-kuhn committed May 26, 2015
1 parent 9b79747 commit ae242f52cac1f2e6969957a51eda6edd950b4a15
Showing with 410 additions and 2 deletions.
  1. +6 −2 src/core/qgsfield.cpp
  2. +404 −0 tests/src/core/testqgsfields.cpp
@@ -203,8 +203,12 @@ void QgsFields::remove( int fieldIdx )
if ( !exists( fieldIdx ) )
return;

mNameToIndex.remove( mFields[fieldIdx].field.name() );
mFields.remove( fieldIdx );
d->fields.remove( fieldIdx );
d->nameToIndex.clear();
for ( int idx = 0; idx < count(); ++idx )
{
d->nameToIndex.insert( d->fields[idx].field.name(), idx );
}
}

void QgsFields::extend( const QgsFields& other )

0 comments on commit ae242f5

Please sign in to comment.