mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Better copying
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6406 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
41b7ca405d
commit
aef56c9336
3 changed files with 13 additions and 7 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
* Headers/gnustep/gui/NSFont.h: Conform to NSCopying.
|
||||
* Source/NSFont.m ([NSFont -copyWithZone:]): Implement.
|
||||
* Source/GSFontInfo.m: (-copyWithZone:): Likewise
|
||||
|
||||
2000-03-31 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
- (NSArray*) availableMembersOfFontFamily: (NSString*)family;
|
||||
@end
|
||||
|
||||
@interface GSFontInfo : NSObject
|
||||
@interface GSFontInfo : NSObject <NSCopying>
|
||||
{
|
||||
NSMutableDictionary* fontDictionary;
|
||||
|
||||
|
|
|
@ -182,12 +182,17 @@ static GSFontEnumerator *sharedEnumerator = nil;
|
|||
- copyWithZone: (NSZone *)zone
|
||||
{
|
||||
GSFontInfo *copy;
|
||||
copy = (GSFontInfo*) NSCopyObject (self, 0, zone);
|
||||
RETAIN(fontDictionary);
|
||||
RETAIN(fontName);
|
||||
RETAIN(familyName);
|
||||
RETAIN(weight);
|
||||
RETAIN(encodingScheme);
|
||||
if (NSShouldRetainWithZone(self, zone))
|
||||
copy = RETAIN(self);
|
||||
else
|
||||
{
|
||||
copy = (GSFontInfo*) NSCopyObject (self, 0, zone);
|
||||
[copy->fontDictionary copyWithZone: zone];
|
||||
[copy->fontName copyWithZone: zone];
|
||||
[copy->familyName copyWithZone: zone];
|
||||
[copy->weight copyWithZone: zone];
|
||||
[copy->encodingScheme copyWithZone: zone];
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue