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:
authorAlex Zolotarev <alex@maps.me>2016-02-29 10:09:11 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:49:31 +0300
commit700e8364e79166f4c259758c586772091ccae2ae (patch)
tree2193685d30eaaa17e06e1da59fa707348d7e8dcd /indexer/categories_holder.cpp
parent65414de6dff9bdfefe212ff4e565fc5a55541227 (diff)
Correctly implement readable categories name in case of non-translated types.
Diffstat (limited to 'indexer/categories_holder.cpp')
-rw-r--r--indexer/categories_holder.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp
index 9266b01fb9..7ee9084732 100644
--- a/indexer/categories_holder.cpp
+++ b/indexer/categories_holder.cpp
@@ -202,21 +202,9 @@ bool CategoriesHolder::GetNameByType(uint32_t type, int8_t locale, string & name
string CategoriesHolder::GetReadableFeatureType(uint32_t type, int8_t locale) const
{
ASSERT_NOT_EQUAL(type, 0, ());
- uint8_t level = ftype::GetLevel(type);
- ASSERT_GREATER(level, 0, ());
-
string name;
- while (true)
- {
- if (GetNameByType(type, locale, name))
- return name;
-
- if (--level == 0)
- break;
-
- ftype::TruncValue(type, level);
- }
-
+ if (GetNameByType(type, locale, name))
+ return name;
return classif().GetReadableObjectName(type);
}