diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2019-04-23 11:44:49 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-04-23 13:55:47 +0300 |
commit | 88c01d55554273f2035bb93ea116f1c2d1b7e649 (patch) | |
tree | 5aa4645d8f5488817952ba83ca72737dcf006e35 /iphone | |
parent | 65dca33c34d9951a027127462710a0fbda98ec4b (diff) |
[base] Replaced base::Key to base::Value as in fact it's a value
Diffstat (limited to 'iphone')
5 files changed, 15 insertions, 15 deletions
diff --git a/iphone/Maps/Core/Bookmarks/MWMBookmarksManager.mm b/iphone/Maps/Core/Bookmarks/MWMBookmarksManager.mm index db8b49e2a2..afe4cdcaa0 100644 --- a/iphone/Maps/Core/Bookmarks/MWMBookmarksManager.mm +++ b/iphone/Maps/Core/Bookmarks/MWMBookmarksManager.mm @@ -227,14 +227,14 @@ NSString * const CloudErrorToString(Cloud::SynchronizationResult result) [self loopObservers:^(id<MWMBookmarksObserver> observer) { if ([observer respondsToSelector:@selector(onSynchronizationFinished:)]) - [observer onSynchronizationFinished:static_cast<MWMSynchronizationResult>(base::Key(result))]; + [observer onSynchronizationFinished:static_cast<MWMSynchronizationResult>(base::Underlying(result))]; }]; }; auto onRestoreRequested = [self](Cloud::RestoringRequestResult result, std::string const & deviceName, uint64_t backupTimestampInMs) { - auto const res = static_cast<MWMRestoringRequestResult>(base::Key(result)); + auto const res = static_cast<MWMRestoringRequestResult>(base::Underlying(result)); NSDate * date = nil; if (result == Cloud::RestoringRequestResult::BackupExists) diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm index 2bd4558e2b..e186398f91 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm @@ -187,7 +187,7 @@ std::array<Class, 9> const kPreviewCells = {{[_MWMPPPTitle class], using namespace place_page; auto tableView = self.tableView; auto const row = data.previewRows[indexPath.row]; - Class cls = kPreviewCells[base::Key(row)]; + Class cls = kPreviewCells[base::Underlying(row)]; auto * c = [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]; switch(row) diff --git a/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm b/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm index 14e393ea0e..a388d678ff 100644 --- a/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm +++ b/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm @@ -17,7 +17,7 @@ static int8_t kAgeOfChild = 5; { if (auto const price = data.hotelRawApproximatePricing) { - CHECK_LESS_OR_EQUAL(*price, base::Key(Price::Three), ()); + CHECK_LESS_OR_EQUAL(*price, base::Underlying(Price::Three), ()); _price = static_cast<Price>(*price); } diff --git a/iphone/Maps/UI/Search/Filters/MWMSearchHotelsFilterViewController.mm b/iphone/Maps/UI/Search/Filters/MWMSearchHotelsFilterViewController.mm index ff79905105..a9b05af143 100644 --- a/iphone/Maps/UI/Search/Filters/MWMSearchHotelsFilterViewController.mm +++ b/iphone/Maps/UI/Search/Filters/MWMSearchHotelsFilterViewController.mm @@ -12,7 +12,7 @@ static NSTimeInterval k30DaysInterval = 30 * kDayInterval; static NSTimeInterval k360DaysInterval = 360 * kDayInterval; static NSString * const kHotelTypePattern = @"search_hotel_filter_%@"; -std::array<ftypes::IsHotelChecker::Type, base::Key(ftypes::IsHotelChecker::Type::Count)> const +std::array<ftypes::IsHotelChecker::Type, base::Underlying(ftypes::IsHotelChecker::Type::Count)> const kTypes = {{ftypes::IsHotelChecker::Type::Hotel, ftypes::IsHotelChecker::Type::Apartment, ftypes::IsHotelChecker::Type::CampSite, ftypes::IsHotelChecker::Type::Chalet, ftypes::IsHotelChecker::Type::GuestHouse, ftypes::IsHotelChecker::Type::Hostel, @@ -362,7 +362,7 @@ void configButton(UIButton * button, NSString * primaryText, NSString * secondar - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return base::Key(Section::Count); + return base::Underlying(Section::Count); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/iphone/Maps/UI/Settings/MWMTTSSettingsViewController.mm b/iphone/Maps/UI/Settings/MWMTTSSettingsViewController.mm index 6727691def..da555685c4 100644 --- a/iphone/Maps/UI/Settings/MWMTTSSettingsViewController.mm +++ b/iphone/Maps/UI/Settings/MWMTTSSettingsViewController.mm @@ -155,7 +155,7 @@ struct CamerasCellStrategy : BaseCellStategy CHECK(title, ()); [cell configWithTitle:title]; - bool const isSelectedCell = base::Key(mode) == indexPath.row; + bool const isSelectedCell = base::Underlying(mode) == indexPath.row; if (isSelectedCell) { m_selectedCell = cell; @@ -171,7 +171,7 @@ struct CamerasCellStrategy : BaseCellStategy size_t NumberOfRows(MWMTTSSettingsViewController * /* controller */) const override { - return base::Key(SpeedCameraManagerMode::MaxValue); + return base::Underlying(SpeedCameraManagerMode::MaxValue); } NSString * TitleForHeader() const override { return L(@"speedcams_alert_title"); } @@ -250,11 +250,11 @@ struct FAQCellStrategy : BaseCellStategy self = [super initWithCoder:aDecoder]; if (self) { - using base::Key; - m_strategies.emplace(Key(Section::VoiceInstructions), make_unique<VoiceInstructionCellStrategy>()); - m_strategies.emplace(Key(Section::Language), make_unique<LanguageCellStrategy>()); - m_strategies.emplace(Key(Section::SpeedCameras), make_unique<CamerasCellStrategy>()); - m_strategies.emplace(Key(Section::FAQ), make_unique<FAQCellStrategy>()); + using base::Underlying; + m_strategies.emplace(Underlying(Section::VoiceInstructions), make_unique<VoiceInstructionCellStrategy>()); + m_strategies.emplace(Underlying(Section::Language), make_unique<LanguageCellStrategy>()); + m_strategies.emplace(Underlying(Section::SpeedCameras), make_unique<CamerasCellStrategy>()); + m_strategies.emplace(Underlying(Section::FAQ), make_unique<FAQCellStrategy>()); } return self; @@ -350,7 +350,7 @@ struct FAQCellStrategy : BaseCellStategy - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return [MWMTextToSpeech isTTSEnabled] ? base::Key(Section::Count) : 1; + return [MWMTextToSpeech isTTSEnabled] ? base::Underlying(Section::Count) : 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section @@ -382,7 +382,7 @@ struct FAQCellStrategy : BaseCellStategy { [MWMTextToSpeech setTTSEnabled:value]; auto indexSet = [NSIndexSet - indexSetWithIndexesInRange:{base::Key(Section::Language), base::Key(Section::Count) - 1}]; + indexSetWithIndexesInRange:{base::Underlying(Section::Language), base::Underlying(Section::Count) - 1}]; auto const animation = UITableViewRowAnimationFade; NSString * statValue = nil; if (value) |