Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorygorshenin <mipt.vi002@gmail.com>2016-07-20 22:52:09 +0300
committerGitHub <noreply@github.com>2016-07-20 22:52:09 +0300
commit612799d306a422d3b27d9cabd4388f2d54b4ccbc (patch)
tree478009719e632ef3cb97848898576d92a45db065 /indexer/osm_editor.cpp
parent6b872bc6ea680eb2d8aeedba7474736c5ce8b108 (diff)
parent99f189642f6c5ae0139cc36ba5ba5106680d9de5 (diff)
Merge pull request #3788 from milchakov/MAPSME-1583_default_name
[editor][ios][android] new way to edit names of place
Diffstat (limited to 'indexer/osm_editor.cpp')
-rw-r--r--indexer/osm_editor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp
index 76e55a5197..1b428c35f0 100644
--- a/indexer/osm_editor.cpp
+++ b/indexer/osm_editor.cpp
@@ -426,6 +426,24 @@ bool Editor::IsCreatedFeature(FeatureID const & fid)
return fid.m_index >= kStartIndexForCreatedFeatures;
}
+bool Editor::OriginalFeatureHasDefaultName(FeatureID const & fid) const
+{
+ if (IsCreatedFeature(fid))
+ return false;
+
+ auto const originalFeaturePtr = m_getOriginalFeatureFn(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