diff --git a/indexer/indexer_tests/osm_editor_test.cpp b/indexer/indexer_tests/osm_editor_test.cpp index dc0a7b8f19..c27e9bcac2 100644 --- a/indexer/indexer_tests/osm_editor_test.cpp +++ b/indexer/indexer_tests/osm_editor_test.cpp @@ -332,47 +332,6 @@ void EditorTest::GetEditedFeatureStreetTest() }); } -void EditorTest::OriginalFeatureHasDefaultNameTest() -{ - auto & editor = osm::Editor::Instance(); - - auto const mwmId = ConstructTestMwm([](TestMwmBuilder & builder) - { - TestCafe cafe(m2::PointD(1.0, 1.0), "London Cafe", "en"); - TestCafe unnamedCafe(m2::PointD(2.0, 2.0), "", "en"); - TestCafe secondUnnamedCafe(m2::PointD(3.0, 3.0), "", "en"); - - builder.Add(cafe); - builder.Add(unnamedCafe); - builder.Add(secondUnnamedCafe); - }); - - ForEachCafeAtPoint(m_index, m2::PointD(1.0, 1.0), [&editor](FeatureType & ft) - { - TEST(editor.OriginalFeatureHasDefaultName(ft.GetID()), ()); - }); - - ForEachCafeAtPoint(m_index, m2::PointD(2.0, 2.0), [&editor](FeatureType & ft) - { - TEST(!editor.OriginalFeatureHasDefaultName(ft.GetID()), ()); - }); - - ForEachCafeAtPoint(m_index, m2::PointD(3.0, 3.0), [&editor](FeatureType & ft) - { - osm::EditableMapObject emo; - FillEditableMapObject(editor, ft, emo); - - StringUtf8Multilang names; - names.AddString(StringUtf8Multilang::GetLangIndex("en"), "Eng name"); - names.AddString(StringUtf8Multilang::GetLangIndex("default"), "Default name"); - emo.SetName(names); - - TEST_EQUAL(editor.SaveEditedFeature(emo), osm::Editor::SaveResult::SavedSuccessfully, ()); - - TEST(!editor.OriginalFeatureHasDefaultName(ft.GetID()), ()); - }); -} - void EditorTest::GetFeatureStatusTest() { auto & editor = osm::Editor::Instance(); @@ -1073,11 +1032,6 @@ UNIT_CLASS_TEST(EditorTest, GetFeatureTypeInfoTest) EditorTest::GetFeatureTypeInfoTest(); } -UNIT_CLASS_TEST(EditorTest, OriginalFeatureHasDefaultNameTest) -{ - EditorTest::OriginalFeatureHasDefaultNameTest(); -} - UNIT_CLASS_TEST(EditorTest, SetIndexTest) { EditorTest::SetIndexTest(); diff --git a/indexer/indexer_tests/osm_editor_test.hpp b/indexer/indexer_tests/osm_editor_test.hpp index fe2b62e71d..39817ab431 100644 --- a/indexer/indexer_tests/osm_editor_test.hpp +++ b/indexer/indexer_tests/osm_editor_test.hpp @@ -25,7 +25,6 @@ public: void GetEditedFeatureTest(); void SetIndexTest(); void GetEditedFeatureStreetTest(); - void OriginalFeatureHasDefaultNameTest(); void GetFeatureStatusTest(); void IsFeatureUploadedTest(); void DeleteFeatureTest(); diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index 03cf10ffdb..cdf2f3312d 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -371,24 +371,6 @@ bool Editor::IsCreatedFeature(FeatureID const & fid) return feature::FakeFeatureIds::IsEditorCreatedFeature(fid.m_index); } -bool Editor::OriginalFeatureHasDefaultName(FeatureID const & fid) const -{ - if (IsCreatedFeature(fid)) - return false; - - auto const originalFeaturePtr = GetOriginalFeature(fid); - if (!originalFeaturePtr) - { - LOG(LERROR, ("A feature with id", fid, "cannot be loaded.")); - alohalytics::LogEvent("Editor_MissingFeature_Error"); - return false; - } - - auto const & names = originalFeaturePtr->GetNames(); - - return names.HasString(StringUtf8Multilang::kDefaultCode); -} - /// Several cases should be handled while saving changes: /// 1) a feature is not in editor's cache /// I. a feature was created diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 9384a1fed3..ecd6ce3036 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -199,7 +199,6 @@ public: // not yet saved and we have to know if it was modified or created. static bool IsCreatedFeature(FeatureID const & fid); // Returns true if the original feature has default name. - bool OriginalFeatureHasDefaultName(FeatureID const & fid) const; private: // TODO(AlexZ): Synchronize Save call/make it on a separate thread. diff --git a/map/framework.cpp b/map/framework.cpp index 7cc6fa9fe3..2cc4e8ad3b 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -3023,11 +3023,6 @@ void Framework::CreateNote(osm::MapObject const & mapObject, DeactivateMapSelection(true /* notifyUI */); } -bool Framework::OriginalFeatureHasDefaultName(FeatureID const & fid) const -{ - return osm::Editor::Instance().OriginalFeatureHasDefaultName(fid); -} - storage::TCountriesVec Framework::GetTopmostCountries(ms::LatLon const & latlon) const { m2::PointD const point = MercatorBounds::FromLatLon(latlon); diff --git a/map/framework.hpp b/map/framework.hpp index a86124a048..c402c64818 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -808,7 +808,6 @@ private: //@} public: - bool OriginalFeatureHasDefaultName(FeatureID const & fid) const; storage::TCountriesVec GetTopmostCountries(ms::LatLon const & latlon) const; private: