Merge with main branch revision 39484

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@39486 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-03-08 21:15:30 +00:00
parent 33ed3c7f75
commit 2e68003300
2 changed files with 34 additions and 27 deletions

View file

@ -41,7 +41,8 @@ ADDITIONAL_CPPFLAGS = \
-DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \
-DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \
-DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \
-DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\"
-DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\" \
-DGNUSTEP_BASE_HAVE_LIBXML=$(GNUSTEP_BASE_HAVE_LIBXML) \
ifneq ($(BACKEND_BUNDLE),)
ADDITIONAL_CPPFLAGS += -DBACKEND_BUNDLE=1

View file

@ -329,20 +329,18 @@
}
else
{
const char *nam = [label cString];
const char *type;
unsigned int size;
int offset;
/*
* Use the GNUstep additional function to set the instance
* variable directly.
* FIXME - need some way to do this for libFoundation and
* Foundation based systems.
* We cannot use the KVC mechanism here, as this would always retain _dst
* and it could also affect _setXXX methods and _XXX ivars that aren't
* affected by the Cocoa code.
*/
if (GSObjCFindVariable(source, nam, &type, &size, &offset))
const char *name = [label cString];
Class class = object_getClass(source);
Ivar ivar = class_getInstanceVariable(class, name);
if (ivar != 0)
{
GSObjCSetVariable(source, offset, size, (void*)&destination);
object_setIvar(source, ivar, destination);
}
}
}
@ -410,7 +408,7 @@
__PRETTY_FUNCTION__,
NSStringFromClass([self class])];
[NSException raise: NSInvalidArgumentException
format: format];
format: @"%@", format];
}
// Load the connection ID....
@ -423,6 +421,7 @@
{
// 4.6+ XIBs....
NSString *string = [coder decodeObjectForKey: @"id"];
if (string && [string isKindOfClass:[NSString class]] && [string length])
{
connectionID = [string intValue];
@ -432,7 +431,7 @@
NSString *format = [NSString stringWithFormat:@"%s:class: %@ - connection ID is missing or zero!",
__PRETTY_FUNCTION__, NSStringFromClass([self class])];
[NSException raise: NSInvalidArgumentException
format: format];
format: @"%@", format];
}
}
else
@ -441,7 +440,7 @@
__PRETTY_FUNCTION__,
NSStringFromClass([self class])];
[NSException raise: NSInvalidArgumentException
format: format];
format: @"%@", format];
}
}
else
@ -581,7 +580,7 @@
__PRETTY_FUNCTION__,
NSStringFromClass([self class])];
[NSException raise: NSInvalidArgumentException
format: format];
format: @"%@", format];
}
if ([coder containsValueForKey: @"object"])
@ -872,10 +871,10 @@
IBUserDefinedRuntimeAttributesPlaceholder *placeholder =
[infodict objectForKey:@"IBUserDefinedRuntimeAttributesPlaceholderName"];
NSArray *attributes = [placeholder runtimeAttributes];
NSEnumerator *objectiter = [attributes objectEnumerator];
IBUserDefinedRuntimeAttribute *attribute = nil;
NSEnumerator *objectIter = [attributes objectEnumerator];
IBUserDefinedRuntimeAttribute *attribute;
while ((attribute = [objectiter nextObject]))
while ((attribute = [objectIter nextObject]) != nil)
{
[realObj setValue:[attribute value] forKeyPath:[attribute keyPath]];
}
@ -911,7 +910,7 @@
}
- (void) awake: (NSArray *)rootObjects
inContainer: (IBObjectContainer *)objects
inContainer: (id)objects
withContext: (NSDictionary *)context
{
NSEnumerator *en;
@ -993,7 +992,9 @@
rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"];
objects = [unarchiver decodeObjectForKey: @"IBDocument.Objects"];
NSDebugLLog(@"XIB", @"rootObjects %@", rootObjects);
[self awake: rootObjects inContainer: objects withContext: context];
[self awake: rootObjects
inContainer: objects
withContext: context];
loaded = YES;
RELEASE(unarchiver);
}
@ -1065,10 +1066,13 @@
- (NSData *) _preProcessXib: (NSData *)data
{
NSData *result = data;
NSData *result = nil;
#if GNUSTEP_BASE_HAVE_LIBXML
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data
options:0
error:NULL];
result = data;
if (document == nil)
{
NSLog(@"%s:DOCUMENT IS NIL: %@\n", __PRETTY_FUNCTION__, document);
@ -1150,15 +1154,15 @@
NSString *className = [customClassDict objectForKey:key];
NSString *objectRecordXpath = nil;
//PRE-4.6 XIBs...
objectRecordXpath = [NSString stringWithFormat:@"//object[@class=\"IBObjectRecord\"]/"
@"int[@key=\"objectID\"][text()=\"%@\"]/../reference",
keyValue];
objectRecords = [document nodesForXPath:objectRecordXpath error:NULL];
// If that didn't work then it could be a 4.6+ XIB...
if (objectRecords == nil)
{
// If that didn't work then it could be a 4.6+ XIB...
objectRecordXpath = [NSString stringWithFormat:@"//object[@class=\"IBObjectRecord\"]/"
@"string[@key=\"id\"][text()=\"%@\"]/../reference",
keyValue];
@ -1182,7 +1186,8 @@
refId = [[record attributeForName:@"ref"] stringValue];
refXpath = [NSString stringWithFormat:@"//object[@id=\"%@\"]",refId];
classNodes = [document nodesForXPath:refXpath error:NULL];
classNodes = [document nodesForXPath:refXpath
error:NULL];
if([classNodes count] > 0)
{
id classAttr = nil;
@ -1223,12 +1228,13 @@
RELEASE(document);
}
}
#endif
return result;
}
- (id) initForReadingWithData: (NSData*)data
{
#if GNUSTEP_BASE_HAVE_LIBXML
NSXMLParser *theParser;
NSData *theData = data;
@ -1264,7 +1270,7 @@
NS_ENDHANDLER
DESTROY(theParser);
#endif
return self;
}