[QGIS Commit] r10122 - trunk/qgis/src/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Feb 7 09:49:53 EST 2009
Author: mhugent
Date: 2009-02-07 09:49:53 -0500 (Sat, 07 Feb 2009)
New Revision: 10122
Modified:
trunk/qgis/src/core/qgsvectorlayer.cpp
Log:
fix for addIsland to work also with polygons that are no longer in the view extent (bug #1495)
Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp 2009-02-07 12:51:13 UTC (rev 10121)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp 2009-02-07 14:49:53 UTC (rev 10122)
@@ -1657,7 +1657,7 @@
}
}
- //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() )
{
@@ -1669,6 +1669,23 @@
}
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
}
More information about the QGIS-commit
mailing list