From 2bd98a69ab487062ec9d54efccde89ce9b8e6929 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Tue, 28 Jan 2014 11:16:48 +0100 Subject: [PATCH] Corrections, according to the comments. Thanks for the review. :-) --- apps/opencs/model/world/commands.cpp | 6 ++---- apps/opencs/model/world/refidcollection.cpp | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 5526d74186..b60ffeb29c 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -170,7 +170,5 @@ void CSMWorld::CloneCommand::redo() void CSMWorld::CloneCommand::undo() { - mModel.removeRow (mModel.getModelIndex (mIdDestination, 0).row()); //should be enough -} - -// kate: indent-mode cstyle; indent-width 4; replace-tabs on; + mModel.removeRow (mModel.getModelIndex (mIdDestination, 0).row()); +} \ No newline at end of file diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index 5e8d381177..5d310208ac 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -2,6 +2,7 @@ #include "refidcollection.hpp" #include +#include #include @@ -453,11 +454,10 @@ void CSMWorld::RefIdCollection::cloneRecord(const std::string& origin, const std::string& destination, const CSMWorld::UniversalId::Type type) { - RecordBase *newRecord = mData.getRecord(mData.searchId(origin)).clone(); + std::auto_ptr newRecord(mData.getRecord(mData.searchId(origin)).clone()); newRecord->mState = RecordBase::State_ModifiedOnly; mAdapters.find(type)->second->setId(*newRecord, destination); mData.insertRecord(*newRecord, type, destination); - delete newRecord; } void CSMWorld::RefIdCollection::appendRecord (const RecordBase& record,