diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 9c31124b4..3a7b6f6cf 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -336,7 +336,7 @@ void OMW::Engine::go() mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoding, mFallbackMap)); //Load translation data - std::unique_ptr translationDataStorage(new TranslationData::Storage(mEncoding)); + std::auto_ptr translationDataStorage(new TranslationData::Storage(mEncoding)); translationDataStorage->loadTranslationData(mFileCollections, mMaster); // Create window manager - this manages all the MW-specific GUI windows diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 40bff0eb0..ad3c9b736 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include "../mwbase/windowmanager.hpp" @@ -252,7 +252,7 @@ namespace MWGui SpellCreationDialog* mSpellCreationDialog; EnchantingDialog* mEnchantingDialog; TrainingWindow* mTrainingWindow; - std::unique_ptr mTranslationDataStorage; + std::auto_ptr mTranslationDataStorage; CharacterCreation* mCharGen; diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 2d2e21633..140bef771 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -62,8 +62,8 @@ add_component_dir (interpreter miscopcodes opcodes runtime scriptopcodes spatialopcodes types ) -add_component_dir (translation_data - translation_data +add_component_dir (translation + translation ) include_directories(${BULLET_INCLUDE_DIRS}) diff --git a/components/translation_data/translation_data.cpp b/components/translation/translation.cpp similarity index 89% rename from components/translation_data/translation_data.cpp rename to components/translation/translation.cpp index cd124bfbc..a178a053c 100644 --- a/components/translation_data/translation_data.cpp +++ b/components/translation/translation.cpp @@ -1,4 +1,4 @@ -#include "translation_data.hpp" +#include "translation.hpp" #include #include @@ -74,7 +74,8 @@ namespace TranslationData std::string Storage::translateCellName(const std::string& cellName) const { - auto entry = mCellNamesTranslations.find(cellName); + std::map::const_iterator entry = + mCellNamesTranslations.find(cellName); if (entry == mCellNamesTranslations.end()) return cellName; @@ -87,7 +88,9 @@ namespace TranslationData std::string result; //seeking for the standard phrase form - auto phraseFormsIterator = mPhraseForms.find(phrase); + std::map::const_iterator phraseFormsIterator = + mPhraseForms.find(phrase); + if (phraseFormsIterator != mPhraseForms.end()) result = phraseFormsIterator->second; else @@ -95,7 +98,9 @@ namespace TranslationData //seeking for the topic ID - auto topicIDIterator = mTopicIDs.find(result); + std::map::const_iterator topicIDIterator = + mTopicIDs.find(result); + if (topicIDIterator != mTopicIDs.end()) result = topicIDIterator->second; diff --git a/components/translation_data/translation_data.hpp b/components/translation/translation.hpp similarity index 100% rename from components/translation_data/translation_data.hpp rename to components/translation/translation.hpp