forked from organicmaps/organicmaps
[editor] Not editable types are not allowed to be created as new features.
This commit is contained in:
parent
873cd1d4c3
commit
32742a73c6
2 changed files with 3 additions and 1 deletions
|
@ -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());
|
||||
|
|
|
@ -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), ());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue