diff --git a/editor/changeset_wrapper.hpp b/editor/changeset_wrapper.hpp index db6ec73e40..07d4696bd0 100644 --- a/editor/changeset_wrapper.hpp +++ b/editor/changeset_wrapper.hpp @@ -27,20 +27,21 @@ public: ChangesetWrapper(TKeySecret const & keySecret, ServerApi06::TKeyValueTags const & comments); ~ChangesetWrapper(); - /// Throws many exceptions, including XMLNode's parsing ones. + /// Throws many exceptions from above list, plus including XMLNode's parsing ones. /// OsmObjectWasDeletedException means that node was deleted from OSM server by someone else. editor::XMLFeature GetMatchingFeatureFromOSM(editor::XMLFeature const & ourPatch, FeatureType const & feature); - /// Throws. + /// Throws exceptions from above list. void ModifyNode(editor::XMLFeature node); private: - // Unfortunately, pugi can't return xml_documents from methods. + /// Unfortunately, pugi can't return xml_documents from methods. + /// Throws exceptions from above list. void LoadXmlFromOSM(ms::LatLon const & ll, pugi::xml_document & doc); ServerApi06::TKeyValueTags m_changesetComments; ServerApi06 m_api; - static constexpr int const kInvalidChangesetId = 0; + static constexpr uint64_t kInvalidChangesetId = 0; uint64_t m_changesetId = kInvalidChangesetId; }; diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index 7a7866f11c..57ad1dd873 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -16,7 +16,7 @@ namespace { constexpr int const kLatLonTolerance = 7; constexpr char const * kTimestamp = "timestamp"; -constexpr char const * kIndex = "mwmFileIndex"; +constexpr char const * kIndex = "mwm_file_index"; constexpr char const * kUploadTimestamp = "upload_timestamp"; constexpr char const * kUploadStatus = "upload_status"; constexpr char const * kUploadError = "upload_error"; diff --git a/indexer/feature.cpp b/indexer/feature.cpp index 544a3e49ae..f712d1215b 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -266,7 +266,7 @@ void FeatureType::ParseMetadata() const m_bMetadataParsed = true; } -StringUtf8Multilang FeatureType::GetNames() const +StringUtf8Multilang const & FeatureType::GetNames() const { return m_params.name; } diff --git a/indexer/feature.hpp b/indexer/feature.hpp index 13a7a6f72e..9c1ef8bf83 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -167,7 +167,7 @@ public: /// @name Editor functions. //@{ - StringUtf8Multilang GetNames() const; + StringUtf8Multilang const & GetNames() const; void SetNames(StringUtf8Multilang const & newNames); void SetMetadata(feature::Metadata const & newMetadata); //@} diff --git a/indexer/index.cpp b/indexer/index.cpp index 57852d456e..7d6e4f6d4a 100644 --- a/indexer/index.cpp +++ b/indexer/index.cpp @@ -129,7 +129,7 @@ void Index::FeaturesLoaderGuard::GetFeatureByIndex(uint32_t index, FeatureType & } } -void Index::FeaturesLoaderGuard::GetNotEditedFeatureByIndex(uint32_t index, FeatureType & ft) const +void Index::FeaturesLoaderGuard::GetOriginalFeatureByIndex(uint32_t index, FeatureType & ft) const { MwmId const & id = m_handle.GetId(); m_vector.GetByIndex(index, ft); diff --git a/indexer/index.hpp b/indexer/index.hpp index 23418655aa..8694055151 100644 --- a/indexer/index.hpp +++ b/indexer/index.hpp @@ -287,7 +287,7 @@ public: /// Everyone, except Editor core, should use this method. void GetFeatureByIndex(uint32_t index, FeatureType & ft) const; /// Editor core only method, to get 'untouched', original version of feature. - void GetNotEditedFeatureByIndex(uint32_t index, FeatureType & ft) const; + void GetOriginalFeatureByIndex(uint32_t index, FeatureType & ft) const; inline FeaturesVector const & GetFeaturesVector() const { return m_vector; } private: diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index a3b647be6e..4acac514eb 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -254,7 +254,7 @@ void Editor::LoadMapEdits() MwmSet::MwmId const id = m_mwmIdByMapNameFn(mapName); if (!id.IsAlive()) { - // TODO(AlexZ): MWM file was deleted, but changes have left. What should we do in this case? + // TODO(AlexZ): MWM file was deleted, but changes remain. What should we do in this case? LOG(LWARNING, (mapName, "version", mapVersion, "references not existing MWM file.")); continue; } @@ -421,11 +421,9 @@ void Editor::EditFeature(FeatureType const & editedFeature, string const & edite fti.m_modificationTimestamp = time(nullptr); fti.m_street = editedStreet; - if (editedHouseNumber.empty()) - fti.m_feature.SetHouseNumber(string()); - else if (feature::IsHouseNumber(editedHouseNumber)) + if (editedHouseNumber.empty() || feature::IsHouseNumber(editedHouseNumber)) fti.m_feature.SetHouseNumber(editedHouseNumber); - // else TODO(AlexZ): Store edited house number as house name. + // TODO(AlexZ): Store edited house number as house name if feature::IsHouseNumber() returned false. // TODO(AlexZ): Synchronize Save call/make it on a separate thread. Save(GetEditorFilePath()); @@ -530,10 +528,11 @@ bool Editor::IsNameEditable(FeatureType const & feature) const bool Editor::IsAddressEditable(FeatureType const & feature) const { feature::TypesHolder const types(feature); + auto & isBuilding = ftypes::IsBuildingChecker::Instance(); for (auto type : types) { // Building addresses are always editable. - if (ftypes::IsBuildingChecker::Instance().HasTypeValue(type)) + if (isBuilding.HasTypeValue(type)) return true; auto const * typeDesc = GetTypeDescription(type); if (typeDesc && typeDesc->address) diff --git a/map/framework.cpp b/map/framework.cpp index 39dc61cfa0..a3669a3d25 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -331,7 +331,7 @@ Framework::Framework() { unique_ptr feature(new FeatureType()); Index::FeaturesLoaderGuard const guard(m_model.GetIndex(), fid.m_mwmId); - guard.GetNotEditedFeatureByIndex(fid.m_index, *feature); + guard.GetOriginalFeatureByIndex(fid.m_index, *feature); feature->ParseEverything(); return feature; });