diff --git a/android/sdk/src/main/cpp/app/organicmaps/sdk/editor/Editor.cpp b/android/sdk/src/main/cpp/app/organicmaps/sdk/editor/Editor.cpp index 653051f46..cfa01c107 100644 --- a/android/sdk/src/main/cpp/app/organicmaps/sdk/editor/Editor.cpp +++ b/android/sdk/src/main/cpp/app/organicmaps/sdk/editor/Editor.cpp @@ -277,7 +277,8 @@ JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_editor_Editor_nativeIsNameEd return g_editableMapObject.IsNameEditable(); } -JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_editor_Editor_nativeCanMarkPlaceAsDisused(JNIEnv * env, jclass clazz) +JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_editor_Editor_nativeCanMarkPlaceAsDisused(JNIEnv * env, + jclass clazz) { return g_editableMapObject.CanMarkPlaceAsDisused(); } diff --git a/libs/editor/osm_editor.cpp b/libs/editor/osm_editor.cpp index e4450460f..b74d11c18 100644 --- a/libs/editor/osm_editor.cpp +++ b/libs/editor/osm_editor.cpp @@ -1321,7 +1321,8 @@ bool Editor::IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId con return info && info->m_uploadStatus == kUploaded; } -void Editor::UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list const & journal, ChangesetWrapper & changeset) +void Editor::UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list const & journal, + ChangesetWrapper & changeset) { for (JournalEntry const & entry : journal) { diff --git a/libs/editor/osm_editor.hpp b/libs/editor/osm_editor.hpp index 0ce517b9a..a08aca5ca 100644 --- a/libs/editor/osm_editor.hpp +++ b/libs/editor/osm_editor.hpp @@ -242,7 +242,8 @@ private: static bool IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId const & mwmId, uint32_t index); - static void UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list const & journal, ChangesetWrapper & changeset); + static void UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list const & journal, + ChangesetWrapper & changeset); /// Deleted, edited and created features. base::AtomicSharedPtr m_features; diff --git a/libs/editor/xml_feature.cpp b/libs/editor/xml_feature.cpp index ea9a4caac..df737bbf1 100644 --- a/libs/editor/xml_feature.cpp +++ b/libs/editor/xml_feature.cpp @@ -599,7 +599,8 @@ void XMLFeature::SetEditJournal(osm::EditJournal const & journal) } case osm::JournalEntryType::BusinessReplacement: { - osm::BusinessReplacementData const & businessReplacementData = std::get(entry.data); + osm::BusinessReplacementData const & businessReplacementData = + std::get(entry.data); xmlData.append_attribute("old_type") = classif().GetReadableObjectName(businessReplacementData.old_type).data(); xmlData.append_attribute("new_type") = classif().GetReadableObjectName(businessReplacementData.new_type).data(); break; @@ -712,7 +713,8 @@ void XMLFeature::OSMBusinessReplacement(uint32_t old_type, uint32_t new_type) std::string name = GetTagValue("name"); // Remove OSM tags using the list from keys_to_remove.hpp - static const boost::regex regex([] { + static boost::regex const regex([] + { std::string regexPattern; for (auto const & key : kKeysToRemove) @@ -747,8 +749,8 @@ void XMLFeature::OSMBusinessReplacement(uint32_t old_type, uint32_t new_type) else { // Add new category tag - ASSERT_FAIL("Only marking places as 'disused' is implemented yet. " - "Wrong new_type: " + classif().GetReadableObjectName(new_type)); + ASSERT_FAIL("Only marking places as 'disused' is implemented yet. Wrong new_type: " + + classif().GetReadableObjectName(new_type)); } } diff --git a/libs/indexer/edit_journal.cpp b/libs/indexer/edit_journal.cpp index 6761200d1..5b458da8e 100644 --- a/libs/indexer/edit_journal.cpp +++ b/libs/indexer/edit_journal.cpp @@ -43,9 +43,10 @@ void EditJournal::MarkAsCreated(uint32_t type, feature::GeomType geomType, m2::P void EditJournal::AddBusinessReplacement(uint32_t old_type, uint32_t new_type) { - LOG(LDEBUG, ("Business of type ", classif().GetReadableObjectName(old_type), - " was replaced by a ", classif().GetReadableObjectName(new_type))); - AddJournalEntry({JournalEntryType::BusinessReplacement, time(nullptr), osm::BusinessReplacementData{old_type, new_type}}); + LOG(LDEBUG, ("Business of type ", classif().GetReadableObjectName(old_type), " was replaced by a ", + classif().GetReadableObjectName(new_type))); + AddJournalEntry( + {JournalEntryType::BusinessReplacement, time(nullptr), osm::BusinessReplacementData{old_type, new_type}}); } void EditJournal::AddJournalEntry(JournalEntry entry) @@ -114,10 +115,10 @@ std::string EditJournal::ToString(osm::JournalEntry const & journalEntry) { BusinessReplacementData const & businessReplacementData = std::get(journalEntry.data); return ToString(journalEntry.journalEntryType) - .append(": Category changed from ") - .append(classif().GetReadableObjectName(businessReplacementData.old_type)) - .append(" to ") - .append(classif().GetReadableObjectName(businessReplacementData.new_type)); + .append(": Category changed from ") + .append(classif().GetReadableObjectName(businessReplacementData.old_type)) + .append(" to ") + .append(classif().GetReadableObjectName(businessReplacementData.new_type)); } default: UNREACHABLE(); } diff --git a/libs/indexer/editable_map_object.cpp b/libs/indexer/editable_map_object.cpp index 2446457e0..68a26567e 100644 --- a/libs/indexer/editable_map_object.cpp +++ b/libs/indexer/editable_map_object.cpp @@ -913,7 +913,7 @@ void EditableMapObject::ApplyBusinessReplacement(uint32_t new_type) new_feature_types.SafeAdd(classif().GetTypeByReadableObjectName(wheelchairType)); std::vector const buildingTypes = ftypes::IsBuildingChecker::Instance().GetTypes(); - for(uint32_t const & type : buildingTypes) + for (uint32_t const & type : buildingTypes) if (m_types.Has(type)) new_feature_types.SafeAdd(type); @@ -936,7 +936,7 @@ void EditableMapObject::ApplyBusinessReplacement(uint32_t new_type) MetadataID::FMD_BUILDING_MIN_LEVEL }; - for(MetadataID const & metadataID : metadataToKeep) + for (MetadataID const & metadataID : metadataToKeep) new_metadata.Set(metadataID, std::string(m_metadata.Get(metadataID))); m_metadata = new_metadata; diff --git a/libs/indexer/editable_map_object.hpp b/libs/indexer/editable_map_object.hpp index 2424393ab..ffa2a8fe4 100644 --- a/libs/indexer/editable_map_object.hpp +++ b/libs/indexer/editable_map_object.hpp @@ -148,6 +148,7 @@ public: void ApplyEditsFromJournal(EditJournal const & journal); void ApplyJournalEntry(JournalEntry const & entry); void LogDiffInJournal(EditableMapObject const & unedited_emo); + private: void ApplyBusinessReplacement(uint32_t new_type);