Skip to content

Commit bc91f2b

Browse files
author
mhugent
committedFeb 7, 2009
backport of bugfix for #1495
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10124 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d059cc6 commit bc91f2b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed
 

‎src/core/qgsvectorlayer.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
16481648
}
16491649
}
16501650

1651-
//else, if must be contained in mCachedGeometries
1651+
//is the feature contained in the view extent (mCachedGeometries) ?
16521652
QgsGeometryMap::iterator cachedIt = mCachedGeometries.find( selectedFeatureId );
16531653
if ( cachedIt != mCachedGeometries.end() )
16541654
{
@@ -1660,6 +1660,23 @@ int QgsVectorLayer::addIsland( const QList<QgsPoint>& ring )
16601660
}
16611661
return errorCode;
16621662
}
1663+
else //maybe the selected feature has been moved outside the visible area and therefore is not contained in mCachedGeometries
1664+
{
1665+
QgsFeature f;
1666+
QgsGeometry* fGeom = 0;
1667+
if(featureAtId( selectedFeatureId, f, true, false ))
1668+
{
1669+
fGeom = f.geometryAndOwnership();
1670+
if(fGeom)
1671+
{
1672+
int errorCode = fGeom->addIsland(ring);
1673+
mChangedGeometries.insert( selectedFeatureId, *fGeom);
1674+
setModified( true, true );
1675+
delete fGeom;
1676+
return errorCode;
1677+
}
1678+
}
1679+
}
16631680

16641681
return 6; //geometry not found
16651682
}

0 commit comments

Comments
 (0)
Please sign in to comment.