Skip to content

Commit

Permalink
fix #6060
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 18, 2012
1 parent b463535 commit cb1e7d3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2410,22 +2410,23 @@ int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topolo
QgsFeature newFeature;
newFeature.setGeometry( newGeometry );

//use default value where possible (primary key issue), otherwise the value from the original (splitted) feature
QgsAttributeMap newAttributes = select_it->attributeMap();
QVariant defaultValue;
for ( int j = 0; j < newAttributes.size(); ++j )
if ( mDataProvider )
{
if ( mDataProvider )
//use default value where possible (primary key issue), otherwise the value from the original (splitted) feature
QgsAttributeMap newAttributes = select_it->attributeMap();
QVariant defaultValue;
foreach( int j, newAttributes.keys() )
{
defaultValue = mDataProvider->defaultValue( j );
if ( !defaultValue.isNull() )
{
newAttributes.insert( j, defaultValue );
}
}

newFeature.setAttributeMap( newAttributes );
}

newFeature.setAttributeMap( newAttributes );
newFeatures.append( newFeature );
}

Expand Down

0 comments on commit cb1e7d3

Please sign in to comment.