Skip to content
Permalink
Browse files

fix #6060

  • Loading branch information
jef-n committed Jul 18, 2012
1 parent b463535 commit cb1e7d3f6b0864d1b448b52e7ccb49faaad20f63
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/core/qgsvectorlayer.cpp
@@ -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 );
}

0 comments on commit cb1e7d3

Please sign in to comment.
You can’t perform that action at this time.