Correctly implement readable categories name in case of non-translated types.

This commit is contained in:
Alex Zolotarev 2016-02-29 10:09:11 +03:00 committed by Sergey Yershov
parent 65414de6df
commit 700e8364e7

View file

@ -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);
}