diff --git a/ChangeLog b/ChangeLog index 52e7fe222..2c4860a8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-12-20 22:13-EST Gregory John Casamento + + * Source/GSNibLoading.m: Read objects/accessibility and oids + maps if we are in a gui builder so that data is accessible. + * Source/NSActionCell.m: Don't archive target/action if they + have no values. + * Source/NSMenu.m: Only archive as "_NSMainMenu" if it has + no parent and is not owner by a popup. + * Source/NSPopUpButtonCell.m: Archive the default menu item + which will show when this popup is displayed. + 2008-12-20 Wolfgang Lux * Source/NSTextView.m (-shouldChangeTextInRange:replacementString:): @@ -25,6 +36,7 @@ * GNUmakefile: Export GNUSTEP_CORE_SOFTWARE to reduce chances of a problem if a GNUmakefile in a subdirectory is missing it. +>>>>>>> .r27362 2008-12-17 21:20-EST Gregory John Casamento * Source/GSNibLoading.m: Remove change which resets the bounds diff --git a/Source/GSNibLoading.m b/Source/GSNibLoading.m index 47bb672ff..b9d8ab29b 100644 --- a/Source/GSNibLoading.m +++ b/Source/GSNibLoading.m @@ -1414,6 +1414,12 @@ static BOOL _isInInterfaceBuilder = NO; NSArray *nameValues = nil; NSArray *classKeys = nil; NSArray *classValues = nil; + NSArray *objectsKeys = nil; + NSArray *objectsValues = nil; + NSArray *oidsKeys = nil; + NSArray *oidsValues = nil; + NSArray *accessibilityOidsKeys = nil; + NSArray *accessibilityOidsValues = nil; ASSIGN(_root, [coder decodeObjectForKey: @"NSRoot"]); ASSIGN(_visibleWindows, @@ -1424,33 +1430,32 @@ static BOOL _isInInterfaceBuilder = NO; ASSIGN(_framework, [coder decodeObjectForKey: @"NSFramework"]); _nextOid = [coder decodeIntForKey: @"NSNextOid"]; - /* - objectsKeys = (NSArray *) - [coder decodeObjectForKey: @"NSObjectsKeys"]; - objectsValues = (NSArray *) - [coder decodeObjectForKey: @"NSObjectsValues"]; - */ nameKeys = (NSArray *) [coder decodeObjectForKey: @"NSNamesKeys"]; nameValues = (NSArray *) [coder decodeObjectForKey: @"NSNamesValues"]; - /* - oidsKeys = (NSArray *) - [coder decodeObjectForKey: @"NSOidsKeys"]; - oidsValues = (NSArray *) - [coder decodeObjectForKey: @"NSOidsValues"]; - */ classKeys = (NSArray *) [coder decodeObjectForKey: @"NSClassesKeys"]; classValues = (NSArray *) [coder decodeObjectForKey: @"NSClassesValues"]; - /* - accessibilityOidsKeys = (NSArray *) - [coder decodeObjectForKey: @"NSAccessibilityOidsKeys"]; - accessibilityOidsValues = (NSArray *) - [coder decodeObjectForKey: @"NSAccessibilityOidsValues"]; - */ - + + // Only get this when in the editor... + if([NSClassSwapper isInInterfaceBuilder]) + { + objectsKeys = (NSArray *) + [coder decodeObjectForKey: @"NSObjectsKeys"]; + objectsValues = (NSArray *) + [coder decodeObjectForKey: @"NSObjectsValues"]; + oidsKeys = (NSArray *) + [coder decodeObjectForKey: @"NSOidsKeys"]; + oidsValues = (NSArray *) + [coder decodeObjectForKey: @"NSOidsValues"]; + accessibilityOidsKeys = (NSArray *) + [coder decodeObjectForKey: @"NSAccessibilityOidsKeys"]; + accessibilityOidsValues = (NSArray *) + [coder decodeObjectForKey: @"NSAccessibilityOidsValues"]; + } + // instantiate the maps.. _objects = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); @@ -1465,9 +1470,6 @@ static BOOL _isInInterfaceBuilder = NO; // Fill in the maps... /* - [self _buildMap: _accessibilityOids - withKeys: accessibilityOidsKeys - andValues: accessibilityOidsValues]; */ [self _buildMap: _classes withKeys: classKeys @@ -1475,14 +1477,21 @@ static BOOL _isInInterfaceBuilder = NO; [self _buildMap: _names withKeys: nameKeys andValues: nameValues]; - /* - [self _buildMap: _objects - withKeys: objectsKeys - andValues: objectsValues]; - [self _buildMap: _oids - withKeys: oidsKeys - andValues: oidsValues]; - */ + + // Only get this when in the editor. + if([NSClassSwapper isInInterfaceBuilder]) + { + [self _buildMap: _accessibilityOids + withKeys: accessibilityOidsKeys + andValues: accessibilityOidsValues]; + [self _buildMap: _objects + withKeys: objectsKeys + andValues: objectsValues]; + [self _buildMap: _oids + withKeys: oidsKeys + andValues: oidsValues]; + } + ASSIGN(_connections, [[coder decodeObjectForKey: @"NSConnections"] mutableCopy]); // instantiate... diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m index 41ea3feb2..d91bfa7e9 100644 --- a/Source/NSActionCell.m +++ b/Source/NSActionCell.m @@ -318,8 +318,14 @@ static Class controlClass; if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: [self tag] forKey: @"NSTag"]; - [aCoder encodeObject: [self target] forKey: @"NSTarget"]; - [aCoder encodeObject: NSStringFromSelector([self action]) forKey: @"NSAction"]; + if([self target] != nil) + { + [aCoder encodeObject: [self target] forKey: @"NSTarget"]; + } + if([self action] != NULL) + { + [aCoder encodeObject: NSStringFromSelector([self action]) forKey: @"NSAction"]; + } [aCoder encodeObject: _control_view forKey: @"NSControlView"]; } else diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 3566f537a..56cb970a6 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -1384,7 +1384,7 @@ static BOOL menuBarVisible = YES; [encoder encodeObject: _items forKey: @"NSMenuItems"]; // if there is no supermenu, make it the main menu. - if ([self supermenu] == nil) + if ([self supermenu] == nil && ![self _ownedByPopUp]) { [encoder encodeObject: @"_NSMainMenu" forKey: @"NSName"]; } diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index f0a0fcfa9..7e6f6817f 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -1058,6 +1058,11 @@ static NSImage *_pbc_image[5]; { [aCoder encodeObject: _menu forKey: @"NSMenu"]; } + + if (_menuItem != nil) + { + [aCoder encodeObject: _menuItem forKey: @"NSMenuItem"]; + } } else {