Skip to content
Permalink
Browse files

Undo changes in active edit command when it gets destroyed.

Fixed return value for deletion of vertices.
Contributed by Richard Kostecky.


git-svn-id: http://svn.osgeo.org/qgis/trunk@11143 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jul 22, 2009
1 parent 2fc5e73 commit 0054b7a41d490478e732d4ecc0274343c4bfb738
Showing with 7 additions and 3 deletions.
  1. +1 −1 python/core/qgsvectorlayer.sip
  2. +5 −1 src/core/qgsvectorlayer.cpp
  3. +1 −1 src/core/qgsvectorlayer.h
@@ -422,7 +422,7 @@ public:
/** Finish edit command and add it to undo/redo stack */
void endEditCommand();

/** Destroy active command and deletes all changes in it */
/** Destroy active command and reverts all changes in it */
void destroyEditCommand();

/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */
@@ -1558,7 +1558,10 @@ bool QgsVectorLayer::deleteVertex( int atFeatureId, int atVertex )
geometry = mChangedGeometries[atFeatureId];
}

geometry.deleteVertex( atVertex );
if (!geometry.deleteVertex( atVertex ))
{
return false;
}
mCachedGeometries[atFeatureId] = geometry;
editGeometryChange( atFeatureId, geometry );

@@ -3885,6 +3888,7 @@ void QgsVectorLayer::destroyEditCommand()
{
if ( mActiveCommand != NULL )
{
undoEditCommand( mActiveCommand );
delete mActiveCommand;
mActiveCommand = NULL;
}
@@ -485,7 +485,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/** Finish edit command and add it to undo/redo stack */
void endEditCommand();

/** Destroy active command and deletes all changes in it */
/** Destroy active command and reverts all changes in it */
void destroyEditCommand();

/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */

0 comments on commit 0054b7a

Please sign in to comment.
You can’t perform that action at this time.