Skip to content
Permalink
Browse files
fix #2819
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13808 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 26, 2010
1 parent f9c984e commit 49dc9961bbf82abf3e7e08649d400e2ca74c129b
Showing with 22 additions and 2 deletions.
  1. +22 −2 src/app/qgisapp.cpp
@@ -4490,14 +4490,34 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
if ( pasteVectorLayer != 0 )
{
pasteVectorLayer->beginEditCommand( tr( "Features pasted" ) );
QgsFeatureList features;
if ( mMapCanvas->mapRenderer()->hasCrsTransformEnabled() )
{
pasteVectorLayer->addFeatures( clipboard()->transformedCopyOf( pasteVectorLayer->srs() ) );
features = clipboard()->transformedCopyOf( pasteVectorLayer->srs() );
}
else
{
pasteVectorLayer->addFeatures( clipboard()->copyOf() );
features = clipboard()->copyOf();
}

QgsAttributeList dstAttr = pasteVectorLayer->pendingAllAttributesList();

for ( int i = 0; i < features.size(); i++ )
{
QgsFeature &f = features[i];
QgsAttributeMap srcMap = f.attributeMap();
QgsAttributeMap dstMap;

int j = 0;
foreach( int id, srcMap.keys() )
{
dstMap[ dstAttr[j++] ] = srcMap[id];
}

f.setAttributeMap( dstMap );
}

pasteVectorLayer->addFeatures( features );
pasteVectorLayer->endEditCommand();
mMapCanvas->refresh();
}

0 comments on commit 49dc996

Please sign in to comment.