[bookmarks] Add house number to pin text if name is empty.

This commit is contained in:
vng 2013-02-13 20:29:34 +03:00 committed by Alex Zolotarev
parent 129b857579
commit f2e148b7b9

View file

@ -576,16 +576,19 @@ void Framework::AddressInfo::MakeFrom(search::Result const & res)
string Framework::AddressInfo::FormatPinText() const
{
// select name or house if name is empty
string const & ret = (m_name.empty() ? m_house : m_name);
char const * type = GetBestType();
if (type)
{
if (m_name.empty())
if (ret.empty())
return type;
else
return m_name + " (" + string(type) + ')';
return ret + " (" + string(type) + ')';
}
else
return m_name;
return ret;
}
string Framework::AddressInfo::FormatAddress() const