Minor tidyup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17987 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-10-28 10:19:51 +00:00
parent a019b68603
commit 5b5d4c307d
2 changed files with 34 additions and 20 deletions

View file

@ -1379,31 +1379,40 @@ GSContactApplication(NSString *appName, NSString *port, NSDate *expire)
NSDictionary *
_serviceFromAnyLocalizedTitle(NSString *title)
{
NSDictionary *allServices;
NSEnumerator *e1;
NSDictionary *service;
NSDictionary *allServices;
NSEnumerator *e1;
NSDictionary *service;
allServices = [manager menuServices];
if(allServices == nil)
return nil;
if([allServices objectForKey: title] != nil)
return [allServices objectForKey: title];
e1 = [allServices objectEnumerator];
while((service = [e1 nextObject]))
if (allServices == nil)
{
NSDictionary *menuItems;
NSString *itemName;
NSEnumerator *e2;
return nil;
}
if ([allServices objectForKey: title] != nil)
{
return [allServices objectForKey: title];
}
e1 = [allServices objectEnumerator];
while ((service = [e1 nextObject]) != nil)
{
NSDictionary *menuItems;
NSString *itemName;
NSEnumerator *e2;
menuItems = [service objectForKey: @"NSMenuItem"];
if(menuItems == nil)
continue;
if (menuItems == nil)
{
continue;
}
e2 = [menuItems objectEnumerator];
while((itemName = [e2 nextObject]))
if([itemName isEqualToString: title])
return service;
while ((itemName = [e2 nextObject]) != nil)
{
if ([itemName isEqualToString: title] == YES)
{
return service;
}
}
}
return nil;