mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/NSCharacterSet.m
([NSCharacterSet _bitmapForSet:number:]): Insure only instances of NSCharacterSet a stored in the cache but return instances of the receivers class. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18014 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9a32828063
commit
6737b2a32f
2 changed files with 23 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2003-10-31 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Source/NSCharacterSet.m
|
||||
([NSCharacterSet _bitmapForSet:number:]): Insure only instances of
|
||||
NSCharacterSet a stored in the cache but return instances of the
|
||||
receivers class.
|
||||
|
||||
2003-10-30 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Headers/Additions/GNUstepBase/GSLock.h: Added missing forward
|
||||
|
|
|
@ -113,9 +113,14 @@ static NSLock* cache_lock = nil;
|
|||
if (set_path != nil)
|
||||
{
|
||||
NS_DURING
|
||||
/* Load the character set file */
|
||||
set = [self characterSetWithBitmapRepresentation:
|
||||
[NSData dataWithContentsOfFile: set_path]];
|
||||
{
|
||||
NSData *data;
|
||||
|
||||
/* Load the character set file */
|
||||
data = [NSData dataWithContentsOfFile: set_path];
|
||||
set = [NSCharacterSet characterSetWithBitmapRepresentation:
|
||||
data];
|
||||
}
|
||||
NS_HANDLER
|
||||
NSLog(@"Unable to read NSCharacterSet file %@", set_path);
|
||||
set = nil;
|
||||
|
@ -145,6 +150,14 @@ static NSLock* cache_lock = nil;
|
|||
set = cache_set[number];
|
||||
|
||||
[cache_lock unlock];
|
||||
|
||||
if ([self isSubclassOfClass: [NSCharacterSet class]])
|
||||
{
|
||||
NSData *data;
|
||||
data = [set bitmapRepresentation];
|
||||
set = [self characterSetWithBitmapRepresentation: data];
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue