mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 04:40:44 +00:00
Move implementation to correct category and fixup variable.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@25620 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f03e51cce5
commit
389f6089d8
1 changed files with 44 additions and 44 deletions
|
@ -713,50 +713,6 @@ fromInsertionInEditingContext: (EOEditingContext *)editingContext
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method is called to validate and potentially coerce
|
||||
* VALUE for the receivers key path. This method also assigns
|
||||
* the value if it is different from the current value.
|
||||
* This method will raise an EOValidationException
|
||||
* if validateValue:forKey: returns an exception.
|
||||
* This method returns new value.
|
||||
**/
|
||||
- (id)validateTakeValue:(id)value forKeyPath:(NSString *)path
|
||||
{
|
||||
id val = value;
|
||||
id obj = self;
|
||||
NSString *lastKey = path;
|
||||
NSException *e;
|
||||
|
||||
/* AYERS: This needs to be verified...
|
||||
normally we would travers the key path so that each
|
||||
object has a chance to override this method the
|
||||
same way we allow this for take value for key.
|
||||
But for now lets assume that we can take this shortcut.
|
||||
*/
|
||||
NSRange r = [path rangeOfString: @"."
|
||||
options: NSBackwardsSearch];
|
||||
|
||||
if (r.length)
|
||||
{
|
||||
NSString *keyPath = [aKey substringToIndex: r.location];
|
||||
lastKey = [aKey substringFromIndex: NSMaxRange(r)];
|
||||
obj = [self valueForKey: keyPath];
|
||||
}
|
||||
e = [obj validateValue:&val forKey:lastKey];
|
||||
|
||||
if (e)
|
||||
{
|
||||
[e raise];
|
||||
}
|
||||
else
|
||||
{
|
||||
[obj takeValue:val forKey: lastKey];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation EOClassDescription (Deprecated)
|
||||
|
@ -1029,6 +985,50 @@ fromInsertionInEditingContext: (EOEditingContext *)editingContext
|
|||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called to validate and potentially coerce
|
||||
* VALUE for the receivers key path. This method also assigns
|
||||
* the value if it is different from the current value.
|
||||
* This method will raise an EOValidationException
|
||||
* if validateValue:forKey: returns an exception.
|
||||
* This method returns new value.
|
||||
**/
|
||||
- (id)validateTakeValue:(id)value forKeyPath:(NSString *)path
|
||||
{
|
||||
id val = value;
|
||||
id obj = self;
|
||||
NSString *lastKey = path;
|
||||
NSException *e;
|
||||
|
||||
/* AYERS: This needs to be verified...
|
||||
normally we would travers the key path so that each
|
||||
object has a chance to override this method the
|
||||
same way we allow this for take value for key.
|
||||
But for now lets assume that we can take this shortcut.
|
||||
*/
|
||||
NSRange r = [path rangeOfString: @"."
|
||||
options: NSBackwardsSearch];
|
||||
|
||||
if (r.length)
|
||||
{
|
||||
NSString *keyPath = [path substringToIndex: r.location];
|
||||
lastKey = [path substringFromIndex: NSMaxRange(r)];
|
||||
obj = [self valueForKey: keyPath];
|
||||
}
|
||||
e = [obj validateValue:&val forKey:lastKey];
|
||||
|
||||
if (e)
|
||||
{
|
||||
[e raise];
|
||||
}
|
||||
else
|
||||
{
|
||||
[obj takeValue:val forKey: lastKey];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
- (NSException *)validateForSave
|
||||
{
|
||||
NSMutableArray *expArray = nil;
|
||||
|
|
Loading…
Reference in a new issue