From 2d53ece56a71a43075eef5c3838b9e9fcc669071 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 9 Jan 2017 16:03:17 +0300 Subject: [PATCH] [search] Clang-format. --- iphone/Maps/Bookmarks/BookmarksRootVC.mm | 10 ++++++---- iphone/Maps/Categories/UILabel+RuntimeAttributes.mm | 1 - .../CircularProgress/MWMCircularProgressView.mm | 3 ++- .../MapViewControls/BottomMenu/MWMBottomMenuView.mm | 5 +++-- iphone/Maps/UI/Editor/MWMEditorViewController.mm | 3 +-- .../MWMOpeningHoursEditorViewController.mm | 3 ++- .../Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm | 8 ++++---- iphone/Maps/UI/PlacePage/MWMPlacePageData.mm | 8 ++++---- .../PlacePageLayout/ActionBar/MWMActionBarButton.mm | 2 +- .../Content/BookmarkCell/MWMBookmarkCell.mm | 3 ++- .../Content/RegularCell/MWMPlacePageInfoCell.mm | 3 +-- .../TabbedView/HistoryTab/MWMSearchHistoryManager.mm | 6 +++--- 12 files changed, 29 insertions(+), 26 deletions(-) diff --git a/iphone/Maps/Bookmarks/BookmarksRootVC.mm b/iphone/Maps/Bookmarks/BookmarksRootVC.mm index df0966f841..82d49d0d9d 100644 --- a/iphone/Maps/Bookmarks/BookmarksRootVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksRootVC.mm @@ -133,10 +133,12 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [coordinator animateAlongsideTransition:^(id context) { - NSArray * ips = self.tableView.indexPathsForVisibleRows; - [self.tableView reloadRowsAtIndexPaths:ips withRowAnimation:UITableViewRowAnimationFade]; - } completion:nil]; + [coordinator + animateAlongsideTransition:^(id context) { + NSArray * ips = self.tableView.indexPathsForVisibleRows; + [self.tableView reloadRowsAtIndexPaths:ips withRowAnimation:UITableViewRowAnimationFade]; + } + completion:nil]; } - (NSString *)truncateString:(NSString *)string toWidth:(CGFloat)width withFont:(UIFont *)font diff --git a/iphone/Maps/Categories/UILabel+RuntimeAttributes.mm b/iphone/Maps/Categories/UILabel+RuntimeAttributes.mm index 7beab8df33..4dc885cad3 100644 --- a/iphone/Maps/Categories/UILabel+RuntimeAttributes.mm +++ b/iphone/Maps/Categories/UILabel+RuntimeAttributes.mm @@ -10,7 +10,6 @@ { self.text = L(localizedText); } - - (NSString *)localizedText { NSString * text = self.text; diff --git a/iphone/Maps/Classes/CustomViews/CircularProgress/MWMCircularProgressView.mm b/iphone/Maps/Classes/CustomViews/CircularProgress/MWMCircularProgressView.mm index 90ae694843..1e3f7e0a97 100644 --- a/iphone/Maps/Classes/CustomViews/CircularProgress/MWMCircularProgressView.mm +++ b/iphone/Maps/Classes/CustomViews/CircularProgress/MWMCircularProgressView.mm @@ -173,7 +173,8 @@ CGFloat angleWithProgress(CGFloat progress) { return 2.0 * M_PI * progress - M_P : @"light"; for (NSUInteger i = 0; i < animationImagesCount; ++i) { - UIImage * image = [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i + 1), postfix]]; + UIImage * image = + [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i + 1), postfix]]; animationImages[i] = image; } self.spinner.animationDuration = 0.8; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm index 794fe5ec53..d77cd6150c 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm @@ -532,8 +532,9 @@ CGFloat constexpr kTimeWidthRegular = 128; NSMutableArray * morphImages = [NSMutableArray arrayWithCapacity:morphImagesCount]; for (NSUInteger i = startValue, j = 0; i != endValue; i += stepValue, j++) { - UIImage * image = [UIImage imageNamed:[NSString stringWithFormat:@"%@%@_%@", morphTemplate, @(i).stringValue, - [UIColor isNightMode] ? @"dark" : @"light"]]; + UIImage * image = + [UIImage imageNamed:[NSString stringWithFormat:@"%@%@_%@", morphTemplate, @(i).stringValue, + [UIColor isNightMode] ? @"dark" : @"light"]]; morphImages[j] = image; } btn.imageView.animationImages = morphImages; diff --git a/iphone/Maps/UI/Editor/MWMEditorViewController.mm b/iphone/Maps/UI/Editor/MWMEditorViewController.mm index f3bff9db98..0b3d9a9010 100644 --- a/iphone/Maps/UI/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/UI/Editor/MWMEditorViewController.mm @@ -961,8 +961,7 @@ void registerCellsForTableView(vector const & cells, UITab CLLocation * location = [[CLLocation alloc] initWithLatitude:latLon.lat longitude:latLon.lon]; self.isFeatureUploaded = osm::Editor::Instance().IsFeatureUploaded(fid.m_mwmId, fid.m_index); NSIndexPath * ip = [self.tableView indexPathForCell:cell]; - [self.tableView reloadRowsAtIndexPaths:@[ip] - withRowAnimation:UITableViewRowAnimationFade]; + [self.tableView reloadRowsAtIndexPaths:@[ ip ] withRowAnimation:UITableViewRowAnimationFade]; auto placeDoesntExistAction = ^{ [self.alertController presentPlaceDoesntExistAlertWithBlock:^(NSString * additionalMessage) { diff --git a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm index 8f1ebee5a0..9b97692410 100644 --- a/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm +++ b/iphone/Maps/UI/Editor/OpeningHours/MWMOpeningHoursEditorViewController.mm @@ -141,7 +141,8 @@ extern NSDictionary * const kMWMOpeningHoursEditorTableCells = @{ - (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath { - UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:[self cellIdentifierForIndexPath:indexPath]]; + UITableViewCell * cell = + [tableView dequeueReusableCellWithIdentifier:[self cellIdentifierForIndexPath:indexPath]]; return cell; } diff --git a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm index d7bb61aff7..b44991cc95 100644 --- a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm +++ b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm @@ -150,10 +150,10 @@ void initFieldsMap() NSNumberFormatter * decimalFormatter = [[NSNumberFormatter alloc] init]; decimalFormatter.numberStyle = NSNumberFormatterDecimalStyle; NSNumber * currencyNumber = [decimalFormatter - numberFromString: - [@(minPrice.c_str()) - stringByReplacingOccurrencesOfString:@"." - withString:decimalFormatter.decimalSeparator]]; + numberFromString:[@(minPrice.c_str()) + stringByReplacingOccurrencesOfString:@"." + withString:decimalFormatter + .decimalSeparator]]; NSString * currencyString = [currencyFormatter stringFromNumber:currencyNumber]; NSString * currencyPattern = [L(@"place_page_starting_from") stringByReplacingOccurrencesOfString:@"%s" diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm index 120537ff2e..979a6808c0 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm @@ -279,10 +279,10 @@ using namespace place_page; decimalFormatter.numberStyle = NSNumberFormatterDecimalStyle; NSNumber * currencyNumber = [decimalFormatter - numberFromString:[@(minPrice.c_str()) - stringByReplacingOccurrencesOfString:@"." - withString:decimalFormatter - .decimalSeparator]]; + numberFromString:[@(minPrice.c_str()) + stringByReplacingOccurrencesOfString:@"." + withString:decimalFormatter + .decimalSeparator]]; NSString * currencyString = [currencyFormatter stringFromNumber:currencyNumber]; NSString * pattern = diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.mm index a6e2e00925..867298653d 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.mm @@ -163,7 +163,7 @@ NSString * titleForButton(EButton type, BOOL isSelected) NSMutableArray * animationImages = [NSMutableArray arrayWithCapacity:animationImagesCount]; for (NSUInteger i = 0; i < animationImagesCount; ++i) { - UIImage * image = [UIImage imageNamed:[NSString stringWithFormat:@"ic_bookmarks_%@", @(i+1)]]; + UIImage * image = [UIImage imageNamed:[NSString stringWithFormat:@"ic_bookmarks_%@", @(i + 1)]]; animationImages[i] = image; } UIImageView * animationIV = btn.imageView; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/BookmarkCell/MWMBookmarkCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/BookmarkCell/MWMBookmarkCell.mm index 22da3c4123..787a349695 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/BookmarkCell/MWMBookmarkCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/BookmarkCell/MWMBookmarkCell.mm @@ -180,7 +180,8 @@ NSString * const kTextViewContentSizeKeyPath = @"contentSize"; NSString * postfix = [UIColor isNightMode] ? @"dark" : @"light"; for (NSUInteger i = 0; i < animationImagesCount; ++i) { - UIImage * image = [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i + 1), postfix]]; + UIImage * image = + [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i + 1), postfix]]; animationImages[i] = image; } self.spinner.animationDuration = 0.8; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm index a5e4c0dd08..3b3ae3bd92 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm @@ -167,8 +167,7 @@ UIView * targetView = [self.textContainer isKindOfClass:[UITextView class]] ? sender.view : self.textContainer; UIView * superview = sender.view.superview; - [menuController setTargetRect:CGRectMake(tapPoint.x, targetView.minY, 0., 0.) - inView:superview]; + [menuController setTargetRect:CGRectMake(tapPoint.x, targetView.minY, 0., 0.) inView:superview]; [menuController setMenuVisible:YES animated:YES]; [targetView becomeFirstResponder]; [menuController update]; diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm index f5589c7c24..3f78db59d6 100644 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm +++ b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm @@ -102,9 +102,9 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition [tCell config:[self stringAtIndex:indexPath.row]]; return tCell; } - UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:self.isRouteSearchMode - ? kMyPositionCellIdentifier - : kClearCellIdentifier]; + UITableViewCell * cell = [tableView + dequeueReusableCellWithIdentifier:self.isRouteSearchMode ? kMyPositionCellIdentifier + : kClearCellIdentifier]; return cell; }