mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
* Source/GSXibLoader.m: Add -replaceObject:withObject: method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36573 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4d4147aab9
commit
7bd5a864cd
2 changed files with 28 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
|||
2013-04-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/GSXibLoader.m: Add -replaceObject:withObject: method.
|
||||
|
||||
2013-04-21 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSPopover.h,
|
||||
|
|
|
@ -1333,6 +1333,30 @@ didStartElement: (NSString*)elementName
|
|||
return [c allocWithZone: [self zone]];
|
||||
}
|
||||
|
||||
- (BOOL) replaceObject: (id)oldObj withObject: (id)newObj
|
||||
{
|
||||
NSEnumerator *keyEnumerator = [decoded keyEnumerator];
|
||||
id key;
|
||||
BOOL found = NO;
|
||||
|
||||
while ((key = [keyEnumerator nextObject]) != nil)
|
||||
{
|
||||
id obj = [decoded objectForKey: key];
|
||||
if (obj == oldObj)
|
||||
{
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
[decoded setObject: newObj forKey: key];
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
- (id) decodeObjectForXib: (GSXibElement*)element
|
||||
forClassName: (NSString*)classname
|
||||
withID: (NSString*)objID
|
||||
|
@ -1492,12 +1516,6 @@ didStartElement: (NSString*)elementName
|
|||
if ([@"object" isEqualToString: elementName])
|
||||
{
|
||||
NSString *classname = [element attributeForKey: @"class"];
|
||||
/*
|
||||
if ([classname isEqualToString:@"NSCustomView"])
|
||||
{
|
||||
classname = @"NSView"; // instantiate an NSView instead...
|
||||
}
|
||||
*/
|
||||
return [self decodeObjectForXib: element
|
||||
forClassName: classname
|
||||
withID: objID];
|
||||
|
|
Loading…
Reference in a new issue