[QGIS Commit] r10124 - branches/Version-1_0/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Feb 7 10:03:25 EST 2009


Author: mhugent
Date: 2009-02-07 10:03:25 -0500 (Sat, 07 Feb 2009)
New Revision: 10124

Modified:
   branches/Version-1_0/src/core/qgsvectorlayer.cpp
Log:
backport of bugfix for #1495

Modified: branches/Version-1_0/src/core/qgsvectorlayer.cpp
===================================================================
--- branches/Version-1_0/src/core/qgsvectorlayer.cpp	2009-02-07 14:54:41 UTC (rev 10123)
+++ branches/Version-1_0/src/core/qgsvectorlayer.cpp	2009-02-07 15:03:25 UTC (rev 10124)
@@ -1648,7 +1648,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() )
   {
@@ -1660,6 +1660,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