forked from organicmaps/organicmaps
[ios] PP title fix
This commit is contained in:
parent
461292281d
commit
5f7b5ff89a
3 changed files with 11 additions and 10 deletions
|
@ -710,19 +710,12 @@ typedef NS_ENUM(NSUInteger, CellRow)
|
|||
}
|
||||
else
|
||||
{
|
||||
_title = [self nonEmptyTitle:[self addressInfo].GetPinName()];
|
||||
_title = [[self nonEmptyTitle:[self addressInfo].GetPinName()] capitalizedStringWithLocale:[NSLocale currentLocale]];
|
||||
}
|
||||
|
||||
NSString * droppedPinTitle = NSLocalizedString(@"dropped_pin", nil);
|
||||
if (![_title length])
|
||||
{
|
||||
if ([_title isEqualToString:droppedPinTitle])
|
||||
self.temporaryTitle = droppedPinTitle;
|
||||
_title = [[self types] capitalizedString];
|
||||
}
|
||||
else if ([_title isEqualToString:droppedPinTitle])
|
||||
{
|
||||
self.temporaryTitle = droppedPinTitle;
|
||||
}
|
||||
}
|
||||
return _title;
|
||||
}
|
||||
|
|
|
@ -168,14 +168,21 @@ void AddressInfo::SetPinName(string const & name)
|
|||
m_name = name;
|
||||
}
|
||||
|
||||
bool AddressInfo::IsEmptyName() const { return m_name.empty() && m_house.empty(); }
|
||||
|
||||
string AddressInfo::GetPinName() const
|
||||
{
|
||||
return m_name.empty() ? m_house : m_name;
|
||||
if (IsEmptyName() && !m_types.empty())
|
||||
return m_types[0];
|
||||
else
|
||||
return m_name.empty() ? m_house : m_name;
|
||||
}
|
||||
|
||||
string AddressInfo::GetPinType() const
|
||||
{
|
||||
char const * type = GetBestType();
|
||||
if (IsEmptyName())
|
||||
return "";
|
||||
return (type ? type : "");
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ struct AddressInfo
|
|||
string FormatTypes() const; // clothes shop
|
||||
string FormatNameAndAddress() const; // Caroline, 7 vulica Frunze, Belarus
|
||||
char const * GetBestType() const;
|
||||
bool IsEmptyName() const;
|
||||
|
||||
void Clear();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue