From 121ec7cac01e68864f3ca06a4359f554092932b0 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 7 Mar 2016 09:33:09 +0300 Subject: [PATCH] =?UTF-8?q?[editor]=20Wrapper=20to=20get=20editable=20prop?= =?UTF-8?q?erties=20by=20feature=E2=80=99s=20types=20only.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indexer/osm_editor.cpp | 7 ++++++- indexer/osm_editor.hpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index e75bb71c61..2b966fd828 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -463,7 +463,12 @@ vector Editor::GetFeaturesByStatus(MwmSet::MwmId const & mwmId, Featur EditableProperties Editor::GetEditableProperties(FeatureType const & feature) const { - feature::TypesHolder const types(feature); + // TODO(mgsergio): Check if feature is in the area where editing is disabled in the config. + return GetEditablePropertiesForTypes(feature::TypesHolder(feature)); +} +// private +EditableProperties Editor::GetEditablePropertiesForTypes(feature::TypesHolder const & types) const +{ editor::TypeAggregatedDescription desc; if (m_config.GetTypeDescription(types.ToObjectNames(), desc)) return {desc.GetEditableFields(), desc.IsNameEditable(), desc.IsAddressEditable()}; diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 8f5bd315e0..003cf85cc0 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -132,6 +132,8 @@ private: /// Notify framework that something has changed and should be redisplayed. void Invalidate(); + EditableProperties GetEditablePropertiesForTypes(feature::TypesHolder const & types) const; + struct FeatureTypeInfo { FeatureStatus m_status;