Skip to content
Permalink
Browse files

copy/paste: do not transform if layer has unknown geometry

  • Loading branch information
3nids committed Mar 3, 2014
1 parent 1d8faf2 commit 9c5c0650b190fe5373bf18b7339ec963df3bbfe7
Showing with 13 additions and 13 deletions.
  1. +13 −13 src/app/qgisapp.cpp
@@ -5624,23 +5624,23 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
if ( featureIt->geometry() )
{
// convert geometry to match destination layer
QgsGeometry* newGeometry = featureIt->geometry()->convertToType( pasteVectorLayer->geometryType(), QGis::isMultiType( pasteVectorLayer->wkbType() ) );
if ( newGeometry )
QGis::GeometryType destType = pasteVectorLayer->geometryType();
bool destIsMulti = QGis::isMultiType( pasteVectorLayer->wkbType() );
if ( destType != QGis::UnknownGeometry )
{
// avoid intersection if enabled in digitize settings
QgsGeometry* newGeometry = featureIt->geometry()->convertToType( destType, destIsMulti );
if ( !newGeometry )
{
featureIt = features.erase( featureIt );
continue;
}
featureIt->setGeometry( newGeometry );
featureIt->geometry()->avoidIntersections();
++featureIt;
}
else
{
featureIt = features.erase( featureIt );
}
// avoid intersection if enabled in digitize settings
featureIt->geometry()->avoidIntersections();
}
else
{
++featureIt;
}

++featureIt;
}

pasteVectorLayer->addFeatures( features );

0 comments on commit 9c5c065

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