From cefa1526f583f1911b99efe93e53285a70353b84 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 23 Mar 2016 17:10:07 +0300 Subject: [PATCH] [ios] Fixed downloader search results bug. --- .../DataSources/MWMMapDownloaderSearchDataSource.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm index 8c3d646a08..c225265a6d 100644 --- a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm +++ b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderSearchDataSource.mm @@ -7,6 +7,7 @@ using namespace storage; extern NSString * const kCountryCellIdentifier; extern NSString * const kSubplaceCellIdentifier; extern NSString * const kPlaceCellIdentifier; +extern NSString * const kLargeCountryCellIdentifier; @interface MWMMapDownloaderSearchDataSource () @@ -66,8 +67,13 @@ extern NSString * const kPlaceCellIdentifier; - (NSString *)cellIdentifierForIndexPath:(NSIndexPath *)indexPath { auto const & s = GetFramework().Storage(); - NodeAttrs nodeAttrs; NSString * countryId = [self countryIdForIndexPath:indexPath]; + TCountriesVec children; + s.GetChildren(countryId.UTF8String, children); + BOOL const haveChildren = !children.empty(); + if (haveChildren) + return kLargeCountryCellIdentifier; + NodeAttrs nodeAttrs; s.GetNodeAttrs(countryId.UTF8String, nodeAttrs); NSString * nodeLocalName = @(nodeAttrs.m_nodeLocalName.c_str()); NSString * matchedResult = [self searchMatchedResultForCountryId:countryId];