diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index ec78775ca8..b98f934c7c 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -631,7 +631,7 @@ EditableProperties Editor::GetEditableProperties(FeatureType const & feature) co if (GetFeatureStatus(feature.GetID()) != FeatureStatus::Created) { auto const originalFeaturePtr = m_getOriginalFeatureFn(feature.GetID()); - if (originalFeaturePtr) + if (!originalFeaturePtr) { LOG(LERROR, ("A feature with id", feature.GetID(), "cannot be loaded.")); alohalytics::LogEvent("Editor_MissingFeature_Error"); @@ -988,7 +988,7 @@ void Editor::MarkFeatureAsObsolete(FeatureID const & fid) // If a feature was modified we can drop all changes since it's now obsolete. auto const originalFeaturePtr = m_getOriginalFeatureFn(fid); - if (originalFeaturePtr) + if (!originalFeaturePtr) { LOG(LERROR, ("A feature with id", fid, "cannot be loaded.")); alohalytics::LogEvent("Editor_MissingFeature_Error"); diff --git a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm index 3bd6bcdff6..af51850c6f 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm @@ -404,8 +404,14 @@ void registerCellsForTableView(vector const & cells, UITab m_sections.push_back(MWMEditorSectionCategory); m_cells[MWMEditorSectionCategory] = kSectionCategoryCellTypes; registerCellsForTableView(kSectionCategoryCellTypes, self.tableView); + BOOL const isNameEditable = m_mapObject.IsNameEditable(); + BOOL const isAddressEditable = m_mapObject.IsAddressEditable(); + BOOL const areEditablePropertiesEmpty = m_mapObject.GetEditableProperties().empty(); + BOOL const isCreating = self.isCreating; + BOOL const isThereNotes = + !isCreating && areEditablePropertiesEmpty && !isAddressEditable && !isNameEditable; - if (m_mapObject.IsNameEditable()) + if (isNameEditable) { m_sections.push_back(MWMEditorSectionName); m_cells[MWMEditorSectionName] = kSectionNameCellTypes; @@ -420,7 +426,8 @@ void registerCellsForTableView(vector const & cells, UITab registerCellsForTableView(cells, self.tableView); [self.additionalNamesHeader setAdditionalNamesVisible:cells.size() > 2]; } - if (m_mapObject.IsAddressEditable()) + + if (isAddressEditable) { m_sections.push_back(MWMEditorSectionAddress); m_cells[MWMEditorSectionAddress] = kSectionAddressCellTypes; @@ -429,7 +436,8 @@ void registerCellsForTableView(vector const & cells, UITab registerCellsForTableView(kSectionAddressCellTypes, self.tableView); } - if (!m_mapObject.GetEditableProperties().empty()) + + if (!areEditablePropertiesEmpty) { auto const cells = cellsForProperties(m_mapObject.GetEditableProperties()); if (!cells.empty()) @@ -439,11 +447,15 @@ void registerCellsForTableView(vector const & cells, UITab registerCellsForTableView(cells, self.tableView); } } - m_sections.push_back(MWMEditorSectionNote); - m_cells[MWMEditorSectionNote] = kSectionNoteCellTypes; - registerCellsForTableView(kSectionNoteCellTypes, self.tableView); - if (self.isCreating) + if (isThereNotes) + { + m_sections.push_back(MWMEditorSectionNote); + m_cells[MWMEditorSectionNote] = kSectionNoteCellTypes; + registerCellsForTableView(kSectionNoteCellTypes, self.tableView); + } + + if (isCreating) return; m_sections.push_back(MWMEditorSectionButton); m_cells[MWMEditorSectionButton] = kSectionButtonCellTypes; @@ -772,10 +784,13 @@ void registerCellsForTableView(vector const & cells, UITab switch (m_sections[section]) { case MWMEditorSectionAddress: - case MWMEditorSectionDetails: case MWMEditorSectionCategory: case MWMEditorSectionAdditionalNames: case MWMEditorSectionButton: return nil; + case MWMEditorSectionDetails: + if (find(m_sections.begin(), m_sections.end(), MWMEditorSectionNote) == m_sections.end()) + return self.notesFooter; + return nil; case MWMEditorSectionName: return self.nameFooter; case MWMEditorSectionNote: return self.notesFooter; } @@ -791,9 +806,12 @@ void registerCellsForTableView(vector const & cells, UITab switch (m_sections[section]) { case MWMEditorSectionAddress: - case MWMEditorSectionDetails: case MWMEditorSectionCategory: case MWMEditorSectionAdditionalNames: return 1.0; + case MWMEditorSectionDetails: + if (find(m_sections.begin(), m_sections.end(), MWMEditorSectionNote) == m_sections.end()) + return self.notesFooter.height; + return 1.0; case MWMEditorSectionNote: return self.notesFooter.height; case MWMEditorSectionName: return self.nameFooter.height; case MWMEditorSectionButton: return kDefaultFooterHeight; diff --git a/iphone/Maps/Classes/MWMBasePlacePageView.mm b/iphone/Maps/Classes/MWMBasePlacePageView.mm index 9948771b7a..0233b25039 100644 --- a/iphone/Maps/Classes/MWMBasePlacePageView.mm +++ b/iphone/Maps/Classes/MWMBasePlacePageView.mm @@ -281,6 +281,7 @@ using namespace storage; else { self.downloadProgressView.hidden = NO; + [self setNeedsLayout]; NodeAttrs nodeAttrs; GetFramework().Storage().GetNodeAttrs(countryId, nodeAttrs); MWMCircularProgress * progress = self.mapDownloadProgress;