Skip to content

Commit b4da995

Browse files
committed
remove fid type check because its done before
1 parent d1172d4 commit b4da995

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/core/qgsofflineediting.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,9 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
750750
// fill gap in QgsAttributeMap if geometry column is not last (WORKAROUND)
751751
QgsAttributes attrs = f.attributes();
752752
int column = 0;
753-
int indexOfFid = layer->dataProvider()->fields().lookupField( "fid" );
754-
if ( containerType == GPKG && ( indexOfFid == -1 || ( layer->dataProvider()->fields().at( indexOfFid ).type() != QVariant::Int
755-
&& layer->dataProvider()->fields().at( indexOfFid ).type() != QVariant::LongLong ) ) )
753+
if ( containerType == GPKG && layer->dataProvider()->fields().lookupField( "fid" ) == -1 )
756754
{
757-
// newAttrs (1) has an additional attribute (fid) that is (2) of the correct type
758-
// so we have to add a dummy because otherwise it messes up with the amount of attributes
755+
// newAttrs has an addition FID attribute, so we have to add a dummy in the original set
759756
column++;
760757
}
761758
QgsAttributes newAttrs( attrs.count() + column );

0 commit comments

Comments
 (0)