Minor portability fix.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7764 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-10-08 20:03:24 +00:00
parent f6e414bff2
commit 6d3aa3231b
2 changed files with 17 additions and 9 deletions

View file

@ -1,3 +1,8 @@
2000-10-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSTextStorage.m: Removed some depen dencies on private
classes of base library.
2000-10-02 Fred Kiefer <FredKiefer@gmx.de> 2000-10-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow.m: * Source/NSWindow.m:

View file

@ -42,7 +42,7 @@
#include <Foundation/NSAttributedString.h> #include <Foundation/NSAttributedString.h>
#include <Foundation/NSException.h> #include <Foundation/NSException.h>
#include <Foundation/NSRange.h> #include <Foundation/NSRange.h>
#include <Foundation/NSGArray.h> #include <Foundation/NSArray.h>
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <AppKit/NSTextStorage.h> #include <AppKit/NSTextStorage.h>
@ -148,15 +148,18 @@ static void _setup()
{ {
if (infCls == 0) if (infCls == 0)
{ {
Class c = [NSGMutableArray class]; NSMutableArray *a;
infCls = [GSTextInfo class]; infCls = [GSTextInfo class];
infImp = [infCls methodForSelector: infSel]; infImp = [infCls methodForSelector: infSel];
addImp = (void (*)())[c instanceMethodForSelector: addSel];
cntImp = (unsigned (*)())[c instanceMethodForSelector: cntSel]; a = [[NSMutableArray allocWithZone: z] initWithCapacity: 1];
insImp = (void (*)())[c instanceMethodForSelector: insSel]; addImp = (void (*)())[a methodForSelector: addSel];
oatImp = [c instanceMethodForSelector: oatSel]; cntImp = (unsigned (*)())[a methodForSelector: cntSel];
remImp = (void (*)())[c instanceMethodForSelector: remSel]; insImp = (void (*)())[a methodForSelector: insSel];
oatImp = [a methodForSelector: oatSel];
remImp = (void (*)())[a methodForSelector: remSel];
RELEASE(a);
} }
} }
@ -345,7 +348,7 @@ _attributesAtIndexEffectiveRange(
NSZone *z = [self zone]; NSZone *z = [self zone];
self = [super initWithString: aString attributes: attributes]; self = [super initWithString: aString attributes: attributes];
infoArray = [[NSGMutableArray allocWithZone: z] initWithCapacity: 1]; infoArray = [[NSMutableArray allocWithZone: z] initWithCapacity: 1];
if (aString != nil && [aString isKindOfClass: [NSAttributedString class]]) if (aString != nil && [aString isKindOfClass: [NSAttributedString class]])
{ {
NSAttributedString *as = (NSAttributedString*)aString; NSAttributedString *as = (NSAttributedString*)aString;
@ -362,7 +365,7 @@ _attributesAtIndexEffectiveRange(
RELEASE(info); RELEASE(info);
} }
if (aString == nil) if (aString == nil)
textChars = [[NSGMutableString allocWithZone: z] init]; textChars = [[NSMutableString allocWithZone: z] init];
else else
textChars = [aString mutableCopyWithZone: z]; textChars = [aString mutableCopyWithZone: z];
return self; return self;