From e1c035e234812b37bc274705d5bac8d10d7089d4 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Wed, 6 Apr 2016 14:00:39 +0300 Subject: [PATCH] [editor] Method to show/hide Add Organisation button. --- indexer/editable_map_object.cpp | 6 ++++++ indexer/editable_map_object.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp index fa7bb218f2..cd689ca92b 100644 --- a/indexer/editable_map_object.cpp +++ b/indexer/editable_map_object.cpp @@ -1,6 +1,7 @@ #include "indexer/classificator.hpp" #include "indexer/cuisines.hpp" #include "indexer/editable_map_object.hpp" +#include "indexer/ftypes_matcher.hpp" #include "base/macros.hpp" @@ -9,6 +10,11 @@ namespace osm bool EditableMapObject::IsNameEditable() const { return m_editableProperties.m_name; } bool EditableMapObject::IsAddressEditable() const { return m_editableProperties.m_address; } +bool EditableMapObject::ShouldDisplayAddOrganisationButton() const +{ + return ftypes::IsBuildingChecker::Instance()(m_types); +} + vector EditableMapObject::GetEditableProperties() const { return MetadataToProps(m_editableProperties.m_metadata); diff --git a/indexer/editable_map_object.hpp b/indexer/editable_map_object.hpp index 3f4aaa2322..3649670b98 100644 --- a/indexer/editable_map_object.hpp +++ b/indexer/editable_map_object.hpp @@ -48,6 +48,7 @@ class EditableMapObject : public MapObject public: bool IsNameEditable() const; bool IsAddressEditable() const; + bool ShouldDisplayAddOrganisationButton() const; vector GetEditableProperties() const; // TODO(AlexZ): Remove this method and use GetEditableProperties() in UI.