From 32742a73c6ded2e95a18a35b9220264e773ef3cc Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 7 Mar 2016 20:38:02 +0200 Subject: [PATCH] [editor] Not editable types are not allowed to be created as new features. --- editor/editor_config.cpp | 2 +- editor/editor_tests/editor_config_test.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor_config.cpp b/editor/editor_config.cpp index c42169b982..73480f6676 100644 --- a/editor/editor_config.cpp +++ b/editor/editor_config.cpp @@ -137,7 +137,7 @@ bool EditorConfig::GetTypeDescription(vector const & classificatorTypes, vector EditorConfig::GetTypesThatCanBeAdded() const { - auto const xpathResult = m_document.select_nodes("/mapsme/editor/types/type[not(@can_add='no')]"); + auto const xpathResult = m_document.select_nodes("/mapsme/editor/types/type[not(@can_add='no' or @editable='no')]"); vector result; for (auto const xNode : xpathResult) result.emplace_back(xNode.node().attribute("id").value()); diff --git a/editor/editor_tests/editor_config_test.cpp b/editor/editor_tests/editor_config_test.cpp index 93d4c9ba93..7fbb92d920 100644 --- a/editor/editor_tests/editor_config_test.cpp +++ b/editor/editor_tests/editor_config_test.cpp @@ -60,4 +60,6 @@ UNIT_TEST(EditorConfig_GetTypesThatGenBeAdded) auto const types = config.GetTypesThatCanBeAdded(); TEST(find(begin(types), end(types), "amenity-cafe") != end(types), ()); TEST(find(begin(types), end(types), "natural-peak") == end(types), ()); + // Marked as "editable=no". + TEST(find(begin(types), end(types), "aeroway-airport") == end(types), ()); }