From ed101c8d447370ba06d92c87879cd4ea4d6a335c Mon Sep 17 00:00:00 2001 From: David Ayers Date: Thu, 12 Feb 2004 10:28:09 +0000 Subject: [PATCH] * EOControl/EOKeyValueQualifier.m ([EOKeyValueQualifier initWithKey:operatorSelector:value:]): Use EONull instance if value is nil. ([EOKeyValueQualifier evaluateWithObject:]): Use EONull instance if object is nil. * EOControl/EOQualifier.m (getKey): Always interpret 'attName = nil' qualifiers as EOKeyValueQualifiers. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@18586 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ EOControl/EOKeyValueQualifier.m | 15 +++++++++++++++ EOControl/EOQualifier.m | 1 + 3 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7fedfe2..63b182a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2003-02-12 David Ayers + * EOControl/EOKeyValueQualifier.m + ([EOKeyValueQualifier initWithKey:operatorSelector:value:]): + Use EONull instance if value is nil. + ([EOKeyValueQualifier evaluateWithObject:]): Use EONull + instance if object is nil. + * EOControl/EOQualifier.m (getKey): Always interpret + 'attName = nil' qualifiers as EOKeyValueQualifiers. + * EOControl/EODebug.h/m(EOFLogAssertGood_): Remove dependancy on superfluous category. ([NSObject isa]): Remove category. diff --git a/EOControl/EOKeyValueQualifier.m b/EOControl/EOKeyValueQualifier.m index e687566..fa782e9 100644 --- a/EOControl/EOKeyValueQualifier.m +++ b/EOControl/EOKeyValueQualifier.m @@ -58,6 +58,7 @@ RCS_ID("$Id$") #include #include #include +#include #include /* @@ -79,6 +80,11 @@ RCS_ID("$Id$") @end @implementation EOKeyValueQualifier +static EONull *null = nil; ++ (void)initialize +{ + null = [EONull null]; +} /** * Returns an autoreleased EOKeyValueQualifier using key, selector and value. @@ -112,6 +118,10 @@ RCS_ID("$Id$") _selector = selector; ASSIGNCOPY(_key, key); + if (value == nil) + { + value = null; + } ASSIGN(_value, value); } @@ -194,6 +204,11 @@ RCS_ID("$Id$") val = [object valueForKey: _key]; + if (val == nil) + { + val = null; + } + imp = (BOOL (*)(id, SEL, id))[val methodForSelector: _selector]; if (imp != NULL) { diff --git a/EOControl/EOQualifier.m b/EOControl/EOQualifier.m index 0cc0240..0b58cf8 100644 --- a/EOControl/EOQualifier.m +++ b/EOControl/EOQualifier.m @@ -214,6 +214,7 @@ static id getKey(const char **cFormat, const char **s, BOOL *isKeyValue, if (value == 0 || value == ' ') { *cFormat = *s = *s+3; + *isKeyValue = YES; return nil; } }