From 316debb8277d6e4b851dc8a85be6efb1c0d248bc Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 27 Jan 2014 14:46:58 +0100 Subject: [PATCH] reformating --- apps/opencs/model/world/commands.cpp | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 3b70f6940..9159b1f16 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -26,34 +26,6 @@ void CSMWorld::ModifyCommand::undo() mModel.setData(mIndex, mOld); } -CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model, - const std::string& idOrigin, - const std::string& IdDestination, - const CSMWorld::UniversalId::Type type, - QUndoCommand* parent) : - QUndoCommand(parent), - mModel(model), - mIdOrigin(idOrigin), - mIdDestination(Misc::StringUtils::lowerCase(IdDestination)), - mType(type) -{ - setText(("Clone record " + idOrigin + " to the " + IdDestination).c_str()); -} - -void CSMWorld::CloneCommand::redo() -{ - mModel.cloneRecord(mIdOrigin, mIdDestination, mType); - - for (std::map::const_iterator iter(mValues.begin()); iter != mValues.end(); ++iter) - mModel.setData(mModel.getModelIndex(mIdDestination, iter->first), iter->second); -} - -void CSMWorld::CloneCommand::undo() -{ - mModel.removeRow(mModel.getModelIndex(mIdDestination, 0).row()); -} - - CSMWorld::CreateCommand::CreateCommand(IdTable& model, const std::string& id, QUndoCommand* parent) : QUndoCommand(parent), mModel(model), mId(id), mType(UniversalId::Type_None) { @@ -174,4 +146,32 @@ void CSMWorld::ReorderRowsCommand::undo() mModel.reorderRows(mBaseIndex, reverse); } + +CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model, + const std::string& idOrigin, + const std::string& IdDestination, + const CSMWorld::UniversalId::Type type, + QUndoCommand* parent) : + QUndoCommand(parent), + mModel(model), + mIdOrigin(idOrigin), + mIdDestination(Misc::StringUtils::lowerCase(IdDestination)), + mType(type) +{ + setText(("Clone record " + idOrigin + " to the " + IdDestination).c_str()); +} + +void CSMWorld::CloneCommand::redo() +{ + mModel.cloneRecord(mIdOrigin, mIdDestination, mType); + + for (std::map::const_iterator iter(mValues.begin()); iter != mValues.end(); ++iter) + mModel.setData(mModel.getModelIndex(mIdDestination, iter->first), iter->second); +} + +void CSMWorld::CloneCommand::undo() +{ + mModel.removeRow(mModel.getModelIndex(mIdDestination, 0).row()); +} + // kate: indent-mode cstyle; indent-width 4; replace-tabs on;