From 9dfbbceaf2a98900590130798415f40677f03e7b Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Mon, 11 Feb 2002 17:21:13 +0000 Subject: [PATCH] Updated for changes in semantics of NSMutableAttributedString -string git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12497 72102866-910b-0410-8b05-ffd578937521 --- Source/NSButtonCell.m | 6 +++++- Source/NSCell.m | 4 ++-- Source/NSMatrix.m | 4 ++-- Source/NSTableView.m | 2 +- Source/NSTextField.m | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index bd5922d1e..bfaa1fb14 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -230,7 +230,11 @@ - (void)setAttributedAlternateTitle:(NSAttributedString *)aString { // TODO - [self setAlternateTitle: [aString string]]; + NSString *alternateTitle; + + alternateTitle = AUTORELEASE ([[aString string] copy]); + + [self setAlternateTitle: alternateTitle]; } - (NSAttributedString *)attributedTitle diff --git a/Source/NSCell.m b/Source/NSCell.m index b0a6c2c0e..69db81ef3 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -254,7 +254,7 @@ static NSColor *shadowCol; } else { - return [(NSAttributedString *)_contents string]; + return AUTORELEASE ([[(NSAttributedString *)_contents string] copy]); } } @@ -1072,7 +1072,7 @@ static NSColor *shadowCol; if (_cell.contents_is_attributed_string) { - c = [(NSAttributedString *)_contents string]; + c = AUTORELEASE ([[(NSAttributedString *)_contents string] copy]); } else { diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 95181e00e..7e53a1e74 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -3337,13 +3337,13 @@ static SEL getSel; - (void) validateEditing { - if (_textObject) + if (_textObject) { NSFormatter *formatter; NSString *string; formatter = [_selectedCell formatter]; - string = [_textObject text]; + string = AUTORELEASE ([[_textObject text] copy]); if (formatter == nil) { diff --git a/Source/NSTableView.m b/Source/NSTableView.m index bf487a5ef..88c35f156 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -1354,7 +1354,7 @@ byExtendingSelection: (BOOL)flag BOOL validatedOK = YES; formatter = [_editedCell formatter]; - string = [_textObject text]; + string = AUTORELEASE ([[_textObject text] copy]); if (formatter == nil) { diff --git a/Source/NSTextField.m b/Source/NSTextField.m index cc89ce946..aa226904a 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -349,7 +349,7 @@ static Class textFieldCellClass; NSString *string; formatter = [_cell formatter]; - string = [_text_object text]; + string = AUTORELEASE ([[_text_object text] copy]); if (formatter == nil) {