mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
decode NSRelation to it's numerical equivalent.
This commit is contained in:
parent
f7b731a75e
commit
58b82dc39a
1 changed files with 22 additions and 0 deletions
|
@ -394,6 +394,7 @@ static NSArray *XmlBoolDefaultYes = nil;
|
|||
@"decodePathStyle:", @"NSPathStyle",
|
||||
@"decodeFirstAttribute:", @"NSFirstAttribute",
|
||||
@"decodeSecondAttribute:", @"NSSecondAttribute",
|
||||
@"decodeRelation:", @"NSRelation",
|
||||
nil];
|
||||
RETAIN(XmlKeyToDecoderSelectorMap);
|
||||
|
||||
|
@ -2863,6 +2864,27 @@ didStartElement: (NSString*)elementName
|
|||
return [self decodeConstraintAttribute: obj];
|
||||
}
|
||||
|
||||
- (id) decodeRelation: (GSXibElement *)element
|
||||
{
|
||||
NSNumber *num = [NSNumber numberWithInteger: 0];
|
||||
id obj = [element attributeForKey: @"relation"];
|
||||
|
||||
if ([obj isEqualToString: @"lessThanOrEqual"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSLayoutRelationLessThanOrEqual];
|
||||
}
|
||||
else if ([obj isEqualToString: @"equal"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSLayoutRelationEqual];
|
||||
}
|
||||
else if ([obj isEqualToString: @"greaterThanOrEqual"])
|
||||
{
|
||||
num = [NSNumber numberWithInteger: NSLayoutRelationGreaterThanOrEqual];
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
- (id) objectForXib: (GSXibElement*)element
|
||||
{
|
||||
id object = [super objectForXib: element];
|
||||
|
|
Loading…
Reference in a new issue