clang-format

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per
2025-11-13 17:46:05 +01:00
parent 237894cd45
commit 005f731faa
7 changed files with 23 additions and 16 deletions

View File

@@ -277,7 +277,8 @@ JNIEXPORT jboolean JNICALL Java_app_organicmaps_sdk_editor_Editor_nativeIsNameEd
return g_editableMapObject.IsNameEditable(); 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(); return g_editableMapObject.CanMarkPlaceAsDisused();
} }

View File

@@ -1321,7 +1321,8 @@ bool Editor::IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId con
return info && info->m_uploadStatus == kUploaded; return info && info->m_uploadStatus == kUploaded;
} }
void Editor::UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list<JournalEntry> const & journal, ChangesetWrapper & changeset) void Editor::UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list<JournalEntry> const & journal,
ChangesetWrapper & changeset)
{ {
for (JournalEntry const & entry : journal) for (JournalEntry const & entry : journal)
{ {

View File

@@ -242,7 +242,8 @@ private:
static bool IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId const & mwmId, uint32_t index); static bool IsFeatureUploadedImpl(FeaturesContainer const & features, MwmId const & mwmId, uint32_t index);
static void UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list<JournalEntry> const & journal, ChangesetWrapper & changeset); static void UpdateXMLFeatureTags(editor::XMLFeature & feature, std::list<JournalEntry> const & journal,
ChangesetWrapper & changeset);
/// Deleted, edited and created features. /// Deleted, edited and created features.
base::AtomicSharedPtr<FeaturesContainer> m_features; base::AtomicSharedPtr<FeaturesContainer> m_features;

View File

@@ -599,7 +599,8 @@ void XMLFeature::SetEditJournal(osm::EditJournal const & journal)
} }
case osm::JournalEntryType::BusinessReplacement: case osm::JournalEntryType::BusinessReplacement:
{ {
osm::BusinessReplacementData const & businessReplacementData = std::get<osm::BusinessReplacementData>(entry.data); osm::BusinessReplacementData const & businessReplacementData =
std::get<osm::BusinessReplacementData>(entry.data);
xmlData.append_attribute("old_type") = classif().GetReadableObjectName(businessReplacementData.old_type).data(); xmlData.append_attribute("old_type") = classif().GetReadableObjectName(businessReplacementData.old_type).data();
xmlData.append_attribute("new_type") = classif().GetReadableObjectName(businessReplacementData.new_type).data(); xmlData.append_attribute("new_type") = classif().GetReadableObjectName(businessReplacementData.new_type).data();
break; break;
@@ -712,7 +713,8 @@ void XMLFeature::OSMBusinessReplacement(uint32_t old_type, uint32_t new_type)
std::string name = GetTagValue("name"); std::string name = GetTagValue("name");
// Remove OSM tags using the list from keys_to_remove.hpp // Remove OSM tags using the list from keys_to_remove.hpp
static const boost::regex regex([] { static boost::regex const regex([]
{
std::string regexPattern; std::string regexPattern;
for (auto const & key : kKeysToRemove) for (auto const & key : kKeysToRemove)
@@ -747,8 +749,8 @@ void XMLFeature::OSMBusinessReplacement(uint32_t old_type, uint32_t new_type)
else else
{ {
// Add new category tag // Add new category tag
ASSERT_FAIL("Only marking places as 'disused' is implemented yet. " ASSERT_FAIL("Only marking places as 'disused' is implemented yet. Wrong new_type: " +
"Wrong new_type: " + classif().GetReadableObjectName(new_type)); classif().GetReadableObjectName(new_type));
} }
} }

View File

@@ -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) void EditJournal::AddBusinessReplacement(uint32_t old_type, uint32_t new_type)
{ {
LOG(LDEBUG, ("Business of type ", classif().GetReadableObjectName(old_type), LOG(LDEBUG, ("Business of type ", classif().GetReadableObjectName(old_type), " was replaced by a ",
" was replaced by a ", classif().GetReadableObjectName(new_type))); classif().GetReadableObjectName(new_type)));
AddJournalEntry({JournalEntryType::BusinessReplacement, time(nullptr), osm::BusinessReplacementData{old_type, new_type}}); AddJournalEntry(
{JournalEntryType::BusinessReplacement, time(nullptr), osm::BusinessReplacementData{old_type, new_type}});
} }
void EditJournal::AddJournalEntry(JournalEntry entry) void EditJournal::AddJournalEntry(JournalEntry entry)
@@ -114,10 +115,10 @@ std::string EditJournal::ToString(osm::JournalEntry const & journalEntry)
{ {
BusinessReplacementData const & businessReplacementData = std::get<BusinessReplacementData>(journalEntry.data); BusinessReplacementData const & businessReplacementData = std::get<BusinessReplacementData>(journalEntry.data);
return ToString(journalEntry.journalEntryType) return ToString(journalEntry.journalEntryType)
.append(": Category changed from ") .append(": Category changed from ")
.append(classif().GetReadableObjectName(businessReplacementData.old_type)) .append(classif().GetReadableObjectName(businessReplacementData.old_type))
.append(" to ") .append(" to ")
.append(classif().GetReadableObjectName(businessReplacementData.new_type)); .append(classif().GetReadableObjectName(businessReplacementData.new_type));
} }
default: UNREACHABLE(); default: UNREACHABLE();
} }

View File

@@ -913,7 +913,7 @@ void EditableMapObject::ApplyBusinessReplacement(uint32_t new_type)
new_feature_types.SafeAdd(classif().GetTypeByReadableObjectName(wheelchairType)); new_feature_types.SafeAdd(classif().GetTypeByReadableObjectName(wheelchairType));
std::vector<uint32_t> const buildingTypes = ftypes::IsBuildingChecker::Instance().GetTypes(); std::vector<uint32_t> const buildingTypes = ftypes::IsBuildingChecker::Instance().GetTypes();
for(uint32_t const & type : buildingTypes) for (uint32_t const & type : buildingTypes)
if (m_types.Has(type)) if (m_types.Has(type))
new_feature_types.SafeAdd(type); new_feature_types.SafeAdd(type);
@@ -936,7 +936,7 @@ void EditableMapObject::ApplyBusinessReplacement(uint32_t new_type)
MetadataID::FMD_BUILDING_MIN_LEVEL 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))); new_metadata.Set(metadataID, std::string(m_metadata.Get(metadataID)));
m_metadata = new_metadata; m_metadata = new_metadata;

View File

@@ -148,6 +148,7 @@ public:
void ApplyEditsFromJournal(EditJournal const & journal); void ApplyEditsFromJournal(EditJournal const & journal);
void ApplyJournalEntry(JournalEntry const & entry); void ApplyJournalEntry(JournalEntry const & entry);
void LogDiffInJournal(EditableMapObject const & unedited_emo); void LogDiffInJournal(EditableMapObject const & unedited_emo);
private: private:
void ApplyBusinessReplacement(uint32_t new_type); void ApplyBusinessReplacement(uint32_t new_type);