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:
authorvng <viktor.govako@gmail.com>2012-09-25 20:17:24 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:43:52 +0300
commitdfb2db05de730607a7496e2f9d89424b49d5ae30 (patch)
treee72c00966bec2bf5eae942bb3860df414675ec67 /map/address_finder.cpp
parent49a7bfc73de52fa58ea972f7281ff8c970f623c8 (diff)
Get raw types in Framework::GetAddressInfo if no types matched in categories.
Diffstat (limited to 'map/address_finder.cpp')
-rw-r--r--map/address_finder.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/map/address_finder.cpp b/map/address_finder.cpp
index 3d70098601..6bb952b4ee 100644
--- a/map/address_finder.cpp
+++ b/map/address_finder.cpp
@@ -150,7 +150,7 @@ namespace
for (size_t i = 0; i < min(count, m_cont.size()); ++i)
for (size_t j = 0; j < m_cont[i].m_types.Size(); ++j)
- types.push_back(c.GetFullObjectName(m_cont[i].m_types[j]));
+ types.push_back(c.GetReadableObjectName(m_cont[i].m_types[j]));
}
private:
@@ -326,7 +326,7 @@ namespace
feature::TypesHolder const & types,
Framework::AddressInfo & info)
{
- // add types for POI
+ // Try to add types from categories.
size_t const count = types.Size();
for (size_t i = 0; i < count; ++i)
{
@@ -343,6 +343,14 @@ namespace
if (!s.empty())
info.m_types.push_back(s);
}
+
+ // If nothing added - return raw classificator types.
+ if (info.m_types.empty())
+ {
+ Classificator const & c = classif();
+ for (size_t i = 0; i < count; ++i)
+ info.m_types.push_back(c.GetReadableObjectName(types[i]));
+ }
}
public: