mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:04:20 +00:00
Move check of index in 'key' before the xpath call
This commit is contained in:
parent
5f3b54e330
commit
f21aa20815
1 changed files with 8 additions and 8 deletions
|
@ -167,14 +167,14 @@
|
|||
//
|
||||
if ([NSClassSwapper isInInterfaceBuilder] == YES)
|
||||
{
|
||||
NSString *xpath = [NSString stringWithFormat: @"//object[@class=\"IBClassDescriber\"]"
|
||||
@"//string[@key=\"className\"][text()=\"%@\"]"
|
||||
@"/../string[@key=\"superclassName\"]", cn];
|
||||
NSArray *descriptionObjs = [document nodesForXPath: xpath error: NULL];
|
||||
if ([descriptionObjs count] > 0)
|
||||
NSUInteger idx = [key rangeOfString: @"."].location;
|
||||
if (idx != NSNotFound) // unlikely to be NSNotFound...
|
||||
{
|
||||
NSUInteger idx = [key rangeOfString: @"."].location;
|
||||
if (idx != NSNotFound) // unlikely to be NSNotFound...
|
||||
NSString *xpath = [NSString stringWithFormat: @"//object[@class=\"IBClassDescriber\"]"
|
||||
@"//string[@key=\"className\"][text()=\"%@\"]"
|
||||
@"/../string[@key=\"superclassName\"]", cn];
|
||||
NSArray *descriptionObjs = [document nodesForXPath: xpath error: NULL];
|
||||
if ([descriptionObjs count] > 0)
|
||||
{
|
||||
NSString *num = [key substringToIndex: idx];
|
||||
NSXMLNode *descriptionNode = [descriptionObjs objectAtIndex: 0];
|
||||
|
@ -189,7 +189,7 @@
|
|||
{
|
||||
NSXMLElement *refNode = [refNodes objectAtIndex: 0];
|
||||
NSString *refId = [refNode stringValue];
|
||||
|
||||
|
||||
[self createCustomClassRecordForId: refId
|
||||
withParentClass: sc
|
||||
forCustomClass: cn];
|
||||
|
|
Loading…
Reference in a new issue