From 2f09829409f3628ed9b9341494934d6567d59b6e Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 11 Sep 2004 16:47:07 +0000 Subject: [PATCH] Corrected an issue and more work on data link. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20044 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/NSCell.m | 20 +++++++------------ Source/NSDataLinkPanel.m | 42 ++++++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2e28dd57..1ea099efb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-09-11 Gregory John Casamento + + * Source/NSCell.m: Reverted previous change. + The change was causing an issue where if the font was + changed on an NSButtonCell which contains both an image and text. + The title was being, incorrectly, reset to "title". + * Source/NSDataLinkPanel.m: Renamed the shared variable to something + more standard. + 2004-09-09 Fred Kiefer * Source/NSCell.m (-setStringValue:, -setFont:, -setImage:): Use diff --git a/Source/NSCell.m b/Source/NSCell.m index b8a2c9557..0b8acfeb4 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -344,10 +344,7 @@ static NSColor *shadowCol; @"Attempt to use nil as string value"); } - if (_cell.type != NSTextCellType) - { - [self setType: NSTextCellType]; - } + _cell.type = NSTextCellType; _cell.contents_is_attributed_string = NO; if (_formatter == nil) @@ -742,13 +739,13 @@ static NSColor *shadowCol; - (void) setFont: (NSFont*)fontObject { - if (_cell.type != NSTextCellType) - { - [self setType: NSTextCellType]; - } - // This does not have any influence on attributed strings ASSIGN (_font, fontObject); + + if (_cell.type != NSTextCellType) + { + _cell.type = NSTextCellType; + } } - (void) setSelectable: (BOOL)flag @@ -973,10 +970,7 @@ static NSColor *shadowCol; NSInvalidArgumentException); } - if (_cell.type != NSImageCellType) - { - [self setType: NSImageCellType]; - } + _cell.type = NSImageCellType; ASSIGN (_cell_image, anImage); } diff --git a/Source/NSDataLinkPanel.m b/Source/NSDataLinkPanel.m index 23c893e3a..4659ffd09 100644 --- a/Source/NSDataLinkPanel.m +++ b/Source/NSDataLinkPanel.m @@ -28,7 +28,7 @@ #include "AppKit/NSNibLoading.h" #include "GSGuiPrivate.h" -static NSDataLinkPanel *__sharedDataLinkPanel; +static NSDataLinkPanel *_sharedDataLinkPanel; @interface GSDataLinkPanelController : NSObject { @@ -43,19 +43,21 @@ static NSDataLinkPanel *__sharedDataLinkPanel; NSString *panelPath; NSDictionary *table; - self = [super init]; - panelPath = [GSGuiBundle() pathForResource: @"GSDataLinkPanel" - ofType: @"gorm" - inDirectory: nil]; - NSLog(@"Panel path=%@",panelPath); - table = [NSDictionary dictionaryWithObject: self forKey: @"NSOwner"]; - if ([NSBundle loadNibFile: panelPath - externalNameTable: table - withZone: [self zone]] == NO) + if((self = [super init]) != nil) { - NSRunAlertPanel(@"Error", @"Could not load data link panel resource", - @"OK", NULL, NULL); - return nil; + panelPath = [GSGuiBundle() pathForResource: @"GSDataLinkPanel" + ofType: @"gorm" + inDirectory: nil]; + NSLog(@"Panel path=%@",panelPath); + table = [NSDictionary dictionaryWithObject: self forKey: @"NSOwner"]; + if ([NSBundle loadNibFile: panelPath + externalNameTable: table + withZone: [self zone]] == NO) + { + NSRunAlertPanel(@"Error", @"Could not load data link panel resource", + @"OK", NULL, NULL); + return nil; + } } return self; @@ -65,6 +67,12 @@ static NSDataLinkPanel *__sharedDataLinkPanel; { return panel; } + +- (void) dealloc +{ + RELEASE(panel); + [super dealloc]; +} @end @implementation NSApplication (NSDataLinkPanel) @@ -100,13 +108,13 @@ static NSDataLinkPanel *__sharedDataLinkPanel; // + (NSDataLinkPanel *)sharedDataLinkPanel { - if(__sharedDataLinkPanel == nil) + if(_sharedDataLinkPanel == nil) { id controller = [[GSDataLinkPanelController alloc] init]; - __sharedDataLinkPanel = [controller panel]; + _sharedDataLinkPanel = [controller panel]; } - NSLog(@"%@",__sharedDataLinkPanel); - return __sharedDataLinkPanel; + NSLog(@"%@",_sharedDataLinkPanel); + return _sharedDataLinkPanel; } //