Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm

Issue 2819283004: [ObjC ARC] Converts ios/chrome/browser/ui/util:util to ARC. (Closed)
Patch Set: Fix copy for block Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
diff --git a/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm b/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
index 56bf04af64cac7d229f4149c7a6db844b0b5c4ff..1abe5d91e5f605e13371205bb37a7ef12995d792 100644
--- a/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
+++ b/ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.mm
@@ -6,10 +6,13 @@
#import <objc/runtime.h>
-#import "base/ios/weak_nsobject.h"
-#include "base/mac/scoped_nsobject.h"
+#include "base/logging.h"
#import "ios/chrome/browser/ui/util/label_observer.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// They key under which to associate the line height with the label.
const void* const kLineHeightKey = &kLineHeightKey;
@@ -57,15 +60,14 @@ CGFloat GetAssociatedLineHeight(UILabel* label) {
if (!self.text.length || !self.attributedText.string.length)
return;
- base::scoped_nsobject<NSMutableAttributedString> newString(
- [self.attributedText mutableCopy]);
+ NSMutableAttributedString* newString = [self.attributedText mutableCopy];
DCHECK([newString length]);
NSParagraphStyle* style = [newString attribute:NSParagraphStyleAttributeName
atIndex:0
effectiveRange:nullptr];
if (!style)
style = [NSParagraphStyle defaultParagraphStyle];
- base::scoped_nsobject<NSMutableParagraphStyle> newStyle([style mutableCopy]);
+ NSMutableParagraphStyle* newStyle = [style mutableCopy];
[newStyle setMinimumLineHeight:lineHeight];
[newStyle setMaximumLineHeight:lineHeight];
[newString addAttribute:NSParagraphStyleAttributeName

Powered by Google App Engine
This is Rietveld 408576698