diff --git a/iphone/Maps/Classes/PlacePageView.mm b/iphone/Maps/Classes/PlacePageView.mm index 23f472df28..b34de75475 100644 --- a/iphone/Maps/Classes/PlacePageView.mm +++ b/iphone/Maps/Classes/PlacePageView.mm @@ -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; } diff --git a/search/result.cpp b/search/result.cpp index 0a3176388a..c3e61424c9 100644 --- a/search/result.cpp +++ b/search/result.cpp @@ -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 : ""); } diff --git a/search/result.hpp b/search/result.hpp index aff55f58b5..36eb443b5d 100644 --- a/search/result.hpp +++ b/search/result.hpp @@ -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(); };