Revision: 18272
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18272&view=rev
Author: hofman
Date: 2011-12-02 23:58:09 +0000 (Fri, 02 Dec 2011)
Log Message:
-----------
Separate common init code
Modified Paths:
--------------
trunk/bibdesk/BDSKIconTextFieldCell.m
Modified: trunk/bibdesk/BDSKIconTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKIconTextFieldCell.m 2011-12-02 18:28:32 UTC (rev
18271)
+++ trunk/bibdesk/BDSKIconTextFieldCell.m 2011-12-02 23:58:09 UTC (rev
18272)
@@ -53,13 +53,19 @@
+ (Class)formatterClass { return Nil; }
+- (void)commonInit {
+ if (imageCell == nil) {
+ imageCell = [[NSImageCell alloc] init];
+ [imageCell setImageScaling:NSImageScaleProportionallyUpOrDown];
+ }
+ if ([self formatter] == nil && [[self class] formatterClass])
+ [self setFormatter:[[[[[self class] formatterClass] alloc] init]
autorelease]];
+}
+
- (id)initTextCell:(NSString *)aString {
self = [super initTextCell:aString];
if (self) {
- imageCell = [[NSImageCell alloc] init];
- [imageCell setImageScaling:NSImageScaleProportionallyUpOrDown];
- if ([[self class] formatterClass])
- [self setFormatter:[[[[[self class] formatterClass] alloc] init]
autorelease]];
+ [self commonInit];
}
return self;
}
@@ -68,12 +74,7 @@
self = [super initWithCoder:decoder];
if (self) {
imageCell = [[decoder decodeObjectForKey:@"imageCell"] retain];
- if (imageCell == nil) {
- imageCell = [[NSImageCell alloc] init];
- [imageCell setImageScaling:NSImageScaleProportionallyUpOrDown];
- }
- if ([self formatter] == nil && [[self class] formatterClass])
- [self setFormatter:[[[[[self class] formatterClass] alloc] init]
autorelease]];
+ [self commonInit];
}
return self;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit