summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 18:09:12 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 18:09:12 +0000
commitab5b9a361b7e6674c04071fa63dc2fce8491b196 (patch)
treea9ae54e28eea5fdaa673d6560f4d65c5e00e5578
parent005067429eed0723ea3284b398ce3edd259d4802 (diff)
downloadchromium_src-ab5b9a361b7e6674c04071fa63dc2fce8491b196.zip
chromium_src-ab5b9a361b7e6674c04071fa63dc2fce8491b196.tar.gz
chromium_src-ab5b9a361b7e6674c04071fa63dc2fce8491b196.tar.bz2
Change two |-autorelease|ed objects to scoped_nsobject<>.
See http://codereview.chromium.org/380010/diff/1/2. BUG=27149 TEST=Style Review URL: http://codereview.chromium.org/405019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32350 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/hyperlink_button_cell.mm13
1 files changed, 6 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/hyperlink_button_cell.mm b/chrome/browser/cocoa/hyperlink_button_cell.mm
index db448ee..91d3a51 100644
--- a/chrome/browser/cocoa/hyperlink_button_cell.mm
+++ b/chrome/browser/cocoa/hyperlink_button_cell.mm
@@ -62,8 +62,8 @@
// Creates the NSDictionary of attributes for the attributed string.
- (NSDictionary*)linkAttributes {
NSUInteger underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle;
- NSMutableParagraphStyle* paragraphStyle =
- [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
+ scoped_nsobject<NSMutableParagraphStyle> paragraphStyle(
+ [[NSParagraphStyle defaultParagraphStyle] mutableCopy]);
[paragraphStyle setAlignment:[self alignment]];
return [NSDictionary dictionaryWithObjectsAndKeys:
@@ -71,7 +71,7 @@
[NSNumber numberWithInt:underlineMask], NSUnderlineStyleAttributeName,
[self font], NSFontAttributeName,
[NSCursor pointingHandCursor], NSCursorAttributeName,
- paragraphStyle, NSParagraphStyleAttributeName,
+ paragraphStyle.get(), NSParagraphStyleAttributeName,
nil
];
}
@@ -81,11 +81,10 @@
- (NSRect)drawTitle:(NSAttributedString*)title
withFrame:(NSRect)frame
inView:(NSView*)controlView {
- NSAttributedString* attrString =
+ scoped_nsobject<NSAttributedString> attrString(
[[NSAttributedString alloc] initWithString:[title string]
- attributes:[self linkAttributes]];
- [attrString autorelease];
- return [super drawTitle:attrString withFrame:frame inView:controlView];
+ attributes:[self linkAttributes]]);
+ return [super drawTitle:attrString.get() withFrame:frame inView:controlView];
}
// Override the default behavior to draw the border. Instead, change the cursor.