From 84e07c95b1d375d0b03d68c6fa1076d39f5e5bf7 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 27 Jan 2014 15:02:29 +0100 Subject: [PATCH] formatting --- apps/opencs/model/world/commands.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 1bb1cf2b2c..a544baee3d 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -8,7 +8,7 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, QUndoCommand* parent) - : QUndoCommand (parent), mModel (model), mIndex (index), mNew (new_) +: QUndoCommand (parent), mModel (model), mIndex (index), mNew (new_) { mOld = mModel.data (mIndex, Qt::EditRole); @@ -26,9 +26,9 @@ void CSMWorld::ModifyCommand::undo() } CSMWorld::CreateCommand::CreateCommand (IdTable& model, const std::string& id, QUndoCommand* parent) - : QUndoCommand (parent), mModel (model), mId (id), mType (UniversalId::Type_None) +: QUndoCommand (parent), mModel (model), mId (id), mType (UniversalId::Type_None) { - setText ( ("Create record " + id).c_str()); + setText (("Create record " + id).c_str()); } void CSMWorld::CreateCommand::addValue (int column, const QVariant& value) @@ -45,7 +45,7 @@ void CSMWorld::CreateCommand::redo() { mModel.addRecord (mId, mType); - for (std::map::const_iterator iter (mValues.begin()); iter != mValues.end(); ++iter) + for (std::map::const_iterator iter (mValues.begin()); iter!=mValues.end(); ++iter) mModel.setData (mModel.getModelIndex (mId, iter->first), iter->second); } @@ -55,9 +55,9 @@ void CSMWorld::CreateCommand::undo() } CSMWorld::RevertCommand::RevertCommand (IdTable& model, const std::string& id, QUndoCommand* parent) - : QUndoCommand (parent), mModel (model), mId (id), mOld (0) +: QUndoCommand (parent), mModel (model), mId (id), mOld (0) { - setText ( ("Revert record " + id).c_str()); + setText (("Revert record " + id).c_str()); mOld = model.getRecord (id).clone(); } @@ -74,7 +74,7 @@ void CSMWorld::RevertCommand::redo() QModelIndex index = mModel.getModelIndex (mId, column); RecordBase::State state = static_cast (mModel.data (index).toInt()); - if (state == RecordBase::State_ModifiedOnly) + if (state==RecordBase::State_ModifiedOnly) { mModel.removeRows (index.row(), 1); } @@ -90,9 +90,9 @@ void CSMWorld::RevertCommand::undo() } CSMWorld::DeleteCommand::DeleteCommand (IdTable& model, const std::string& id, QUndoCommand* parent) - : QUndoCommand (parent), mModel (model), mId (id), mOld (0) +: QUndoCommand (parent), mModel (model), mId (id), mOld (0) { - setText ( ("Delete record " + id).c_str()); + setText (("Delete record " + id).c_str()); mOld = model.getRecord (id).clone(); } @@ -109,7 +109,7 @@ void CSMWorld::DeleteCommand::redo() QModelIndex index = mModel.getModelIndex (mId, column); RecordBase::State state = static_cast (mModel.data (index).toInt()); - if (state == RecordBase::State_ModifiedOnly) + if (state==RecordBase::State_ModifiedOnly) { mModel.removeRows (index.row(), 1); } @@ -127,7 +127,7 @@ void CSMWorld::DeleteCommand::undo() CSMWorld::ReorderRowsCommand::ReorderRowsCommand (IdTable& model, int baseIndex, const std::vector& newOrder) - : mModel (model), mBaseIndex (baseIndex), mNewOrder (newOrder) +: mModel (model), mBaseIndex (baseIndex), mNewOrder (newOrder) {} void CSMWorld::ReorderRowsCommand::redo() @@ -140,7 +140,7 @@ void CSMWorld::ReorderRowsCommand::undo() int size = static_cast (mNewOrder.size()); std::vector reverse (size); - for (int i = 0; i < size; ++i) + for (int i=0; i < size; ++i) reverse.at (mNewOrder[i]) = i; mModel.reorderRows (mBaseIndex, reverse);