From d81e01b6002895d45e2a3502846b065df6cb54e7 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 11 Mar 2008 19:15:43 +0000 Subject: [PATCH] fixed a MacOS 10.5 issue git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1616 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-core/NGExtensions/ChangeLog | 4 ++++ .../FdExt.subproj/NSArray+enumerator.m | 18 ++++++++++++++++-- sope-core/NGExtensions/Version | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 2bf42ebb..9a952ce2 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,7 @@ +2008-03-11 Helge Hess + + * FdExt.subproj/NSArray+enumerator.m: fixed for MacOS 10.5 (v4.7.201) + 2008-02-21 Helge Hess * FdExt.subproj/NSString+Escaping.m: fixed a free() bug introduced in diff --git a/sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m b/sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m index de3d6665..8c8a8bb0 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m +++ b/sope-core/NGExtensions/FdExt.subproj/NSArray+enumerator.m @@ -1,5 +1,6 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2008 SKYRIX Software AG + Copyright (C) 2008 Helge Hess This file is part of SOPE. @@ -118,13 +119,26 @@ @implementation NSMutableArray(enumerator) - (id)initWithObjectsFromEnumerator:(NSEnumerator *)_enumerator { - if ((self = [self init])) { +#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY + NSMutableArray *ma = [[NSMutableArray alloc] initWithCapacity:64]; + id obj; + + while ((obj = [_enumerator nextObject])) + [ma addObject:obj]; + + self = [self initWithArray:ma]; + [ma release]; ma = nil; + return self; +#else + if ((self = [self init]) != nil) { id obj = nil; + // Does not work on Cocoa because we only have NSCFArray over there ... while ((obj = [_enumerator nextObject])) [self addObject:obj]; } return self; +#endif } @end /* NSMutableArray(enumerator) */ diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 1f300e3b..9a2efb0b 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=200 +SUBMINOR_VERSION:=201 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 -- 2.39.5