diff --git a/common/commit.cpp b/common/commit.cpp index f398ad6399..54b1278436 100644 --- a/common/commit.cpp +++ b/common/commit.cpp @@ -3,6 +3,7 @@ * * Copyright (C) 2016 CERN * @author Tomasz Wlostowski + * @author Maciej Suminski * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -77,7 +78,7 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType ) } -COMMIT& COMMIT::Stage( EDA_ITEM* aItem, EDA_ITEM* aCopy ) +COMMIT& COMMIT::Modified( EDA_ITEM* aItem, EDA_ITEM* aCopy ) { EDA_ITEM* parent = parentObject( aItem ); @@ -120,7 +121,7 @@ COMMIT& COMMIT::Stage( const PICKED_ITEMS_LIST& aItems, UNDO_REDO_T aModFlag ) assert( change_type == UR_CHANGED ); // There was already a copy created, so use it - Stage( item, copy ); + Modified( item, copy ); } else { diff --git a/include/commit.h b/include/commit.h index 3741536f68..646e991a4b 100644 --- a/include/commit.h +++ b/include/commit.h @@ -3,6 +3,7 @@ * * Copyright (C) 2016 CERN * @author Tomasz Wlostowski + * @author Maciej Suminski * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -104,12 +105,13 @@ public: return Stage( aItem, CHT_MODIFY ); } + ///> Creates an undo entry for an item that has been already modified. Requires a copy done + ///> before the modification. + COMMIT& Modified( EDA_ITEM* aItem, EDA_ITEM* aCopy ); + ///> Adds a change of the item aItem of type aChangeType to the change list. COMMIT& Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType ); - ///> Adds a change of an item with its copy done before the change has occurred. - COMMIT& Stage( EDA_ITEM* aItem, EDA_ITEM* aCopy ); - COMMIT& Stage( std::vector& container, CHANGE_TYPE aChangeType ); COMMIT& Stage( const PICKED_ITEMS_LIST& aItems, UNDO_REDO_T aModFlag = UR_UNSPECIFIED );