diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index 8ecad816b..74019dda7 100644 --- a/apps/opencs/model/world/collection.hpp +++ b/apps/opencs/model/world/collection.hpp @@ -205,6 +205,7 @@ namespace CSMWorld const UniversalId::ArgumentType argumentType) { Record copy = getRecord(origin); + copy.mState = RecordBase::State_ModifiedOnly; if (argumentType == UniversalId::ArgumentType_Id) { copy.get().mId = destination; diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 04e35cdaa..69fb4ab1e 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -194,6 +194,7 @@ CSMWorld::Data::Data() : mRefs (mCells) mRefs.addColumn (new StringIdColumn (true)); mRefs.addColumn (new RecordStateColumn); + mRefs.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Reference)); mRefs.addColumn (new CellColumn); mRefs.addColumn (new IdColumn); mRefs.addColumn (new PosColumn (&CellRef::mPos, 0, false)); diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index d4008fb87..f131f7087 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -133,8 +133,6 @@ void CSMWorld::IdTable::cloneRecord(const std::string& origin, beginInsertRows (QModelIndex(), index, index); mIdCollection->cloneRecord(origin, destination, type, argumentType); endInsertRows(); - emit dataChanged (CSMWorld::IdTable::index (0, 0), - CSMWorld::IdTable::index (mIdCollection->getSize()-1, mIdCollection->getColumns()-1)); } diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 2ecd3b663..6b0081258 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -43,10 +43,8 @@ void CSMWorld::RefCollection::cloneRecord(const std::string& origin, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType) { - Record originRecord = getRecord(origin); - Record *copy = dynamic_cast* >(originRecord.clone()); - copy->mState = CSMWorld::RecordBase::State_ModifiedOnly; - copy->get().mId = getNewId(); - insertRecord(*copy, getAppendIndex(destination, type)); - delete copy; + Record clone(getRecord(origin)); + clone.mState = CSMWorld::RecordBase::State_ModifiedOnly; + clone.get().mId = destination; + insertRecord(clone, getAppendIndex(destination, type), type); } \ No newline at end of file diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index 2fcce9186..ab387393b 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -157,9 +157,4 @@ void CSVWorld::GenericCreator::cloneMode(const std::string& originid, mClonedId = originid; mClonedType = type; mArgumentType = argumentType; - - if (argumentType == CSMWorld::UniversalId::ArgumentType_Id) - { - mId->setText(QString::fromStdString(mClonedId)); - } -} +} \ No newline at end of file diff --git a/apps/opencs/view/world/referencecreator.cpp b/apps/opencs/view/world/referencecreator.cpp index aef25a81d..06b3eb76d 100644 --- a/apps/opencs/view/world/referencecreator.cpp +++ b/apps/opencs/view/world/referencecreator.cpp @@ -40,9 +40,9 @@ CSVWorld::ReferenceCreator::ReferenceCreator (CSMWorld::Data& data, QUndoStack& void CSVWorld::ReferenceCreator::reset() { + GenericCreator::reset(); mCell->setText (""); mId = getData().getReferences().getNewId(); - GenericCreator::reset(); } std::string CSVWorld::ReferenceCreator::getErrors() const