forked from organicmaps/organicmaps
Fixed bug in matching categories for one-word classificator type.
This commit is contained in:
parent
69d65a9066
commit
bfdb2314bf
1 changed files with 9 additions and 2 deletions
|
@ -402,12 +402,19 @@ string Engine::GetCountryName(string const & id)
|
|||
bool Engine::GetNameByType(uint32_t type, int8_t locale, string & name) const
|
||||
{
|
||||
uint8_t level = ftype::GetLevel(type);
|
||||
while (level >= 2)
|
||||
ASSERT_GREATER(level, 0, ());
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (m_pData->m_categories.GetNameByType(type, locale, name))
|
||||
return true;
|
||||
ftype::TruncValue(type, --level);
|
||||
|
||||
if (--level == 0)
|
||||
break;
|
||||
|
||||
ftype::TruncValue(type, level);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue