]> err.no Git - sope/commitdiff
Bugfix for OSX
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 30 Oct 2004 01:21:51 +0000 (01:21 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 30 Oct 2004 01:21:51 +0000 (01:21 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@326 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-xml/SaxObjC/ChangeLog
sope-xml/SaxObjC/SaxObjectModel.m
sope-xml/SaxObjC/Version

index dad8af1d90bf02dc9e9d56cd124740e0d955297e..edfdf1ab2c4738326c51f6f770ccff46e9bfa450 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-30  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * SaxObjectDecoder.m: provide fix for discovering mutable array on
+         Apple/CoreFoundation - this is rather disturbing, but Apple really
+         broke the concept of mutability for NSArray/NSDictionary. (v4.3.42)
+
 2004-09-22  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * SaxObjC.xcode: minor fixes
index 7c8f1d7cee3a251e1d9dab33ee8edf9a12297046..8e150097df095766c6f04edfb3db2d35b9f1fc3b 100644 (file)
 #include "SaxObjectModel.h"
 #include "common.h"
 
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+    APPLE_FOUNDATION_LIBRARY
+bool _CFArrayIsMutable(CFArrayRef dict);
+#endif
+
 static NSDictionary *mapDictsToObjects(NSDictionary *_dict, Class clazz) {
   NSMutableDictionary *md;
   NSEnumerator *e;
@@ -45,6 +50,19 @@ static NSDictionary *mapDictsToObjects(NSDictionary *_dict, Class clazz) {
 static BOOL    doDebug = NO;
 static NSArray *searchPathes = nil;
 
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+    APPLE_FOUNDATION_LIBRARY
+static Class NSCFArrayClass = Nil;
+
++ (void)initialize {
+  static BOOL isInitialized = NO;
+  
+  if (isInitialized) return;
+  isInitialized = YES;
+    NSCFArrayClass = NSClassFromString(@"NSCFArray");
+#endif
+}
+
 + (NSArray *)saxMappingSearchPathes {
   if (searchPathes == nil) {
     NSMutableArray *ma;
@@ -384,7 +402,13 @@ static NSArray *searchPathes = nil;
         [_object takeValue:[NSArray arrayWithObject:_value] forKey:_key];
       }
       else {
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+    APPLE_FOUNDATION_LIBRARY
+        if ([v isKindOfClass:NSCFArrayClass] &&
+            _CFArrayIsMutable((CFArrayRef)v))
+#else
         if ([v respondsToSelector:@selector(addObject:)])
+#endif
          /* the value is mutable */
           [v addObject:_value];
         else {
index b64cd5801f8619965d88b347e58edfa46efd36d2..6f16b3c2caec12336ce2fcd4f92d51b6463b10f3 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=41
+SUBMINOR_VERSION:=42