[QGIS Commit] r12455 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Dec 14 15:46:16 EST 2009


Author: jef
Date: 2009-12-14 15:46:13 -0500 (Mon, 14 Dec 2009)
New Revision: 12455

Modified:
   trunk/qgis/src/app/qgsmaptooladdisland.cpp
   trunk/qgis/src/app/qgsmaptooladdring.cpp
Log:
fix #2281

Modified: trunk/qgis/src/app/qgsmaptooladdisland.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdisland.cpp	2009-12-14 19:36:57 UTC (rev 12454)
+++ trunk/qgis/src/app/qgsmaptooladdisland.cpp	2009-12-14 20:46:13 UTC (rev 12455)
@@ -104,9 +104,8 @@
 
     //close polygon
     mCaptureList.push_back( *mCaptureList.begin() );
-    vlayer->beginEditCommand( tr( "Island added" ) );
+    vlayer->beginEditCommand( tr( "Part added" ) );
     int errorCode = vlayer->addIsland( mCaptureList );
-    vlayer->endEditCommand();
     QString errorMessage;
 
     if ( errorCode != 0 )
@@ -136,6 +135,8 @@
         errorMessage = tr( "Selected geometry could not be found" );
       }
       QMessageBox::critical( 0, tr( "Error, could not add island" ), errorMessage );
+
+      vlayer->destroyEditCommand();
     }
     else
     {
@@ -145,6 +146,8 @@
       {
         addTopologicalPoints( mCaptureList );
       }
+
+      vlayer->endEditCommand();
     }
 
     mCaptureList.clear();

Modified: trunk/qgis/src/app/qgsmaptooladdring.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdring.cpp	2009-12-14 19:36:57 UTC (rev 12454)
+++ trunk/qgis/src/app/qgsmaptooladdring.cpp	2009-12-14 20:46:13 UTC (rev 12455)
@@ -83,7 +83,6 @@
 
     vlayer->beginEditCommand( tr( "Ring added" ) );
     int addRingReturnCode = vlayer->addRing( mCaptureList );
-    vlayer->endEditCommand();
     if ( addRingReturnCode != 0 )
     {
       QString errorMessage;
@@ -113,7 +112,12 @@
         errorMessage = tr( "An unknown error occured" );
       }
       QMessageBox::critical( 0, tr( "Error, could not add ring" ), errorMessage );
+      vlayer->destroyEditCommand();
     }
+    else
+    {
+      vlayer->endEditCommand();
+    }
     mCaptureList.clear();
     mCanvas->refresh();
   }



More information about the QGIS-commit mailing list