[editor] Not editable types are not allowed to be created as new features.

This commit is contained in:
Alex Zolotarev 2016-03-07 20:38:02 +02:00 committed by Sergey Yershov
parent 873cd1d4c3
commit 32742a73c6
2 changed files with 3 additions and 1 deletions

View file

@ -137,7 +137,7 @@ bool EditorConfig::GetTypeDescription(vector<string> const & classificatorTypes,
vector<string> 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<string> result;
for (auto const xNode : xpathResult)
result.emplace_back(xNode.node().attribute("id").value());

View file

@ -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), ());
}