diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index 156c5f9c71..ad8d3690b8 100644 --- a/apps/opencs/model/world/collection.hpp +++ b/apps/opencs/model/world/collection.hpp @@ -100,7 +100,7 @@ namespace CSMWorld public: Collection(); - virtual ~Collection(); + ~Collection() override; void add(const ESXRecordT& record); ///< Add a new record (modified) @@ -119,10 +119,10 @@ namespace CSMWorld const ColumnBase& getColumn(int column) const override; - virtual void merge(); + void merge(); ///< Merge modified into base. - virtual void purge(); + void purge(); ///< Remove records that are flagged as erased. void removeRows(int index, int count) override; diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index fbe002080c..1479e82286 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -276,19 +276,6 @@ void CSMWorld::RefCollection::removeRows(int index, int count) } } -void CSMWorld::RefCollection::appendBlankRecord(const std::string& id, UniversalId::Type type) -{ - auto record = std::make_unique>(); - - record->mState = Record::State_ModifiedOnly; - record->mModified.blank(); - - record->get().mId = ESM::RefId::stringRefId(id); - record->get().mIdNum = extractIdNum(id); - - Collection::appendRecord(std::move(record)); -} - void CSMWorld::RefCollection::appendBlankRecord(const ESM::RefId& id, UniversalId::Type type) { auto record = std::make_unique>(); @@ -316,11 +303,6 @@ void CSMWorld::RefCollection::cloneRecord( insertRecord(std::move(copy), getAppendIndex(destination, type)); // call RefCollection::insertRecord() } -int CSMWorld::RefCollection::searchId(std::string_view id) const -{ - return searchId(extractIdNum(id)); -} - int CSMWorld::RefCollection::searchId(const ESM::RefId& id) const { return searchId(extractIdNum(id.getRefIdString())); diff --git a/apps/opencs/model/world/refcollection.hpp b/apps/opencs/model/world/refcollection.hpp index 066e5ec3d9..a5e5fd3b6f 100644 --- a/apps/opencs/model/world/refcollection.hpp +++ b/apps/opencs/model/world/refcollection.hpp @@ -34,7 +34,7 @@ namespace CSMWorld void Collection::insertRecord(std::unique_ptr record, int index, UniversalId::Type type); /// \brief References in cells - class RefCollection : public Collection + class RefCollection final : public Collection { Collection& mCells; std::map mRefIndex; // CellRef index keyed by CSMWorld::CellRef::mIdNum @@ -61,20 +61,19 @@ namespace CSMWorld std::string getNewId(); - virtual void removeRows(int index, int count); + void removeRows(int index, int count) override; - virtual void appendBlankRecord(const std::string& id, UniversalId::Type type = UniversalId::Type_None); - virtual void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None); + void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None) override; - virtual void cloneRecord(const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type); + void cloneRecord( + const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type) override; - virtual int searchId(std::string_view id) const; - virtual int searchId(const ESM::RefId& id) const; + int searchId(const ESM::RefId& id) const override; - virtual void appendRecord(std::unique_ptr record, UniversalId::Type type = UniversalId::Type_None); + void appendRecord(std::unique_ptr record, UniversalId::Type type = UniversalId::Type_None) override; - virtual void insertRecord( - std::unique_ptr record, int index, UniversalId::Type type = UniversalId::Type_None); + void insertRecord( + std::unique_ptr record, int index, UniversalId::Type type = UniversalId::Type_None) override; }; } diff --git a/apps/opencs/model/world/subcellcollection.hpp b/apps/opencs/model/world/subcellcollection.hpp index 88df21b4d4..f7cb896aca 100644 --- a/apps/opencs/model/world/subcellcollection.hpp +++ b/apps/opencs/model/world/subcellcollection.hpp @@ -14,7 +14,7 @@ namespace CSMWorld /// \brief Single type collection of top level records that are associated with cells template - class SubCellCollection : public NestedIdCollection + class SubCellCollection final : public NestedIdCollection { const IdCollection& mCells;