Skip to content
Permalink
Browse files

backport of bugfix for #1495

git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10124 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Feb 7, 2009
1 parent d059cc6 commit bc91f2b973d36af001f23789cd89622f5e22f7a0
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/core/qgsvectorlayer.cpp
@@ -1648,7 +1648,7 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
}
}

//else, if must be contained in mCachedGeometries
//is the feature contained in the view extent (mCachedGeometries) ?
QgsGeometryMap::iterator cachedIt = mCachedGeometries.find( selectedFeatureId );
if ( cachedIt != mCachedGeometries.end() )
{
@@ -1660,6 +1660,23 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
}
return errorCode;
}
else //maybe the selected feature has been moved outside the visible area and therefore is not contained in mCachedGeometries
{
QgsFeature f;
QgsGeometry* fGeom = 0;
if(featureAtId( selectedFeatureId, f, true, false ))
{
fGeom = f.geometryAndOwnership();
if(fGeom)
{
int errorCode = fGeom->addIsland(ring);
mChangedGeometries.insert( selectedFeatureId, *fGeom);
setModified( true, true );
delete fGeom;
return errorCode;
}
}
}

return 6; //geometry not found
}

0 comments on commit bc91f2b

Please sign in to comment.