From bc2486ddfd0dcd2887b2e9377b625a7cc2bad897 Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 26 Nov 2007 19:15:47 +0000 Subject: [PATCH] changed component sync to use setValue:forKey: on gstep-base git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1552 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 6 ++++++ sope-appserver/NGObjWeb/Version | 2 +- sope-appserver/NGObjWeb/WOComponent+Sync.m | 19 +++++++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 975ee85b..02e3fc65 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,9 @@ +2007-11-26 Helge Hess + + * WOComponent+Sync.m: use -setValue:forKey: instead of + -takeValue:forKey: on gnustep-base (might also make sense on Cocoa + starting with 10.4). As suggested by Sebastian (v4.7.18) + 2007-10-16 Helge Hess * WEClientCapabilities.m: added wdfs as a known (WebDAV) user agent diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 613891cf..07c9dd8f 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=17 +SUBMINOR_VERSION:=18 # v4.7.11 requires libNGExtensions v4.7.194 # v4.5.234 requires libDOM v4.5.21 diff --git a/sope-appserver/NGObjWeb/WOComponent+Sync.m b/sope-appserver/NGObjWeb/WOComponent+Sync.m index 4d46afa7..fd9c5159 100644 --- a/sope-appserver/NGObjWeb/WOComponent+Sync.m +++ b/sope-appserver/NGObjWeb/WOComponent+Sync.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2005 SKYRIX Software AG + Copyright (C) 2000-2007 SKYRIX Software AG This file is part of SOPE. @@ -80,12 +80,15 @@ void WOComponent_syncFromParent(WOComponent *self, WOComponent *_parent) { CHK_WOCDICT_CACHE; #if NeXT_RUNTIME takeValue = (void *)[self methodForSelector:@selector(takeValue:forKey:)]; +#elif GNUSTEP_BASE_LIBRARY + takeValue = (void*)method_get_imp(class_get_instance_method(self->isa, + @selector(setValue:forKey:))); #else takeValue = (void*)method_get_imp(class_get_instance_method(self->isa, @selector(takeValue:forKey:))); #endif - while ((key = nextKey(keys, @selector(nextObject)))) { + while ((key = nextKey(keys, @selector(nextObject))) != nil) { static Class lastAssocClass = Nil; // THREAD static id (*valInComp)(id, SEL, WOComponent *); register WOAssociation *binding; @@ -97,7 +100,7 @@ void WOComponent_syncFromParent(WOComponent *self, WOComponent *_parent) { lastAssocClass = *(Class *)binding; #if NeXT_RUNTIME valInComp = (void *) - [binding methodForSelector:@selector(valueInComponent:)]; + [binding methodForSelector:@selector(valueInComponent:)]; #else valInComp = (void *) method_get_imp(class_get_instance_method(*(Class *)binding, @@ -117,7 +120,11 @@ void WOComponent_syncFromParent(WOComponent *self, WOComponent *_parent) { // parameter is a string because ObjC doesn't know about bool // and will evaluate the string as a char value // (this is common if you use const:mykey="YES" in WOx) +#if GNUSTEP_BASE_LIBRARY + takeValue(self, @selector(setValue:forKey:), value, key); +#else takeValue(self, @selector(takeValue:forKey:), value, key); +#endif } } @@ -139,7 +146,7 @@ void WOComponent_syncToParent(WOComponent *self, WOComponent *_parent) { @selector(valueForKey:))); #endif - while ((key = nextKey(keys, @selector(nextObject)))) { + while ((key = nextKey(keys, @selector(nextObject))) != nil) { static Class lastAssocClass = Nil; static BOOL (*isSettable)(id, SEL); static void (*setValInComp)(id, SEL, id, WOComponent *); @@ -153,9 +160,9 @@ void WOComponent_syncToParent(WOComponent *self, WOComponent *_parent) { #if NeXT_RUNTIME isSettable = - (void*)[binding methodForSelector:@selector(isValueSettable)]; + (void*)[binding methodForSelector:@selector(isValueSettable)]; setValInComp = - (void*)[binding methodForSelector:@selector(setValue:inComponent:)]; + (void*)[binding methodForSelector:@selector(setValue:inComponent:)]; #else isSettable = (void*) method_get_imp(class_get_instance_method(*(Class *)binding, -- 2.39.5