From 6d3aa3231be5607f35a60901d431b3caa89e8a65 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 8 Oct 2000 20:03:24 +0000 Subject: [PATCH] Minor portability fix. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7764 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/GSTextStorage.m | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ed53b75d..604dcdc51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-10-08 Richard Frith-Macdonald + + * Source/GSTextStorage.m: Removed some depen dencies on private + classes of base library. + 2000-10-02 Fred Kiefer * Source/NSWindow.m: diff --git a/Source/GSTextStorage.m b/Source/GSTextStorage.m index e01c62817..da4cfd94a 100644 --- a/Source/GSTextStorage.m +++ b/Source/GSTextStorage.m @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -148,15 +148,18 @@ static void _setup() { if (infCls == 0) { - Class c = [NSGMutableArray class]; + NSMutableArray *a; infCls = [GSTextInfo class]; infImp = [infCls methodForSelector: infSel]; - addImp = (void (*)())[c instanceMethodForSelector: addSel]; - cntImp = (unsigned (*)())[c instanceMethodForSelector: cntSel]; - insImp = (void (*)())[c instanceMethodForSelector: insSel]; - oatImp = [c instanceMethodForSelector: oatSel]; - remImp = (void (*)())[c instanceMethodForSelector: remSel]; + + a = [[NSMutableArray allocWithZone: z] initWithCapacity: 1]; + addImp = (void (*)())[a methodForSelector: addSel]; + cntImp = (unsigned (*)())[a methodForSelector: cntSel]; + 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]; 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]]) { NSAttributedString *as = (NSAttributedString*)aString; @@ -362,7 +365,7 @@ _attributesAtIndexEffectiveRange( RELEASE(info); } if (aString == nil) - textChars = [[NSGMutableString allocWithZone: z] init]; + textChars = [[NSMutableString allocWithZone: z] init]; else textChars = [aString mutableCopyWithZone: z]; return self;