diff --git a/data/editor.config b/data/editor.config index 893912ea8f..997f09c2ca 100644 --- a/data/editor.config +++ b/data/editor.config @@ -91,8 +91,8 @@ - - + + @@ -124,6 +124,7 @@ + @@ -732,12 +733,6 @@ - - - - - - diff --git a/editor/editor_config.cpp b/editor/editor_config.cpp index eaa70d2faf..9920464136 100644 --- a/editor/editor_config.cpp +++ b/editor/editor_config.cpp @@ -37,7 +37,7 @@ static unordered_map const kNamesToFMD= { {"height", feature::Metadata::FMD_HEIGHT}, // {"", feature::Metadata::FMD_MIN_HEIGHT}, {"denomination", feature::Metadata::FMD_DENOMINATION}, - {"building_levels", feature::Metadata::FMD_BUILDING_LEVELS} + {"building:levels", feature::Metadata::FMD_BUILDING_LEVELS} // description }; @@ -120,9 +120,22 @@ EditorConfig::EditorConfig(string const & fileName) Reload(); } -bool EditorConfig::GetTypeDescription(vector const & classificatorTypes, +bool EditorConfig::GetTypeDescription(vector classificatorTypes, TypeAggregatedDescription & outDesc) const { + bool isBuilding = false; + for (auto it = classificatorTypes.begin(); it != classificatorTypes.end(); ++it) + { + if (*it == "building") + { + outDesc.m_address = isBuilding = true; + outDesc.m_editableFields.push_back(feature::Metadata::FMD_BUILDING_LEVELS); + outDesc.m_editableFields.push_back(feature::Metadata::FMD_POSTCODE); + classificatorTypes.erase(it); + break; + } + } + auto const typeNodes = GetPrioritizedTypes(m_document); auto const it = find_if(begin(typeNodes), end(typeNodes), [&classificatorTypes](pugi::xml_node const & node) @@ -131,7 +144,7 @@ bool EditorConfig::GetTypeDescription(vector const & classificatorTypes, node.attribute("id").value()) != end(classificatorTypes); }); if (it == end(typeNodes)) - return false; + return isBuilding; return TypeDescriptionFromXml(m_document, *it, outDesc); } diff --git a/editor/editor_config.hpp b/editor/editor_config.hpp index 7985185af4..399f03c10a 100644 --- a/editor/editor_config.hpp +++ b/editor/editor_config.hpp @@ -43,7 +43,8 @@ class EditorConfig public: EditorConfig(string const & fileName = "editor.config"); - bool GetTypeDescription(vector const & classificatorTypes, TypeAggregatedDescription & outDesc) const; + // TODO(mgsergio): Reduce overhead by matching uint32_t types instead of strings. + bool GetTypeDescription(vector classificatorTypes, TypeAggregatedDescription & outDesc) const; vector GetTypesThatCanBeAdded() const; bool EditingEnable() const;