Move toolbar ivar from NSWindowTemplate5 to NSWindowTemplate.

This commit is contained in:
fredkiefer 2020-01-22 20:29:19 +01:00
parent eae3f9e991
commit 3ac76af826
4 changed files with 20 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2020-01-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSXib5KeyedUnarchiver.m,
* Headers/Additions/GNUstepGUI/GSNibLoading.h,
* Source/GSXibLoading.m: Move toolbar ivar from NSWindowTemplate5
to NSWindowTemplate.
2020-01-22 Fred Kiefer <FredKiefer@gmx.de>
* TextConverters/RTF/rtfScanner.m: Add RTFansicpg.

View file

@ -143,6 +143,7 @@ typedef struct _GSWindowTemplateFlags
GSWindowTemplateFlags _flags;
NSString *_autosaveName;
Class _baseWindowClass;
NSToolbar *_toolbar;
}
- (id) initWithWindow: (NSWindow *)window
className: (NSString *)windowClass

View file

@ -424,6 +424,11 @@ static BOOL _isInInterfaceBuilder = NO;
_windowStyle |= NSTitledWindowMask;
}
if ([coder containsValueForKey: @"NSToolbar"])
{
_toolbar = [coder decodeObjectForKey: @"NSToolbar"];
}
_baseWindowClass = [NSWindow class];
}
else
@ -455,6 +460,7 @@ static BOOL _isInInterfaceBuilder = NO;
[aCoder encodeRect: rect forKey: @"NSWindowRect"];
[aCoder encodeObject: _title forKey: @"NSWindowTitle"];
[aCoder encodeObject: _autosaveName forKey: @"NSFrameAutosaveName"];
[aCoder encodeObject: _toolbar forKey: @"NSToolbar"];
}
}
@ -514,6 +520,10 @@ static BOOL _isInInterfaceBuilder = NO;
// FIXME: No idea what is going on here
[_realObject setToolbar: (NSToolbar*)_viewClass];
}
if (_toolbar)
{
[_realObject setToolbar: _toolbar];
}
[_realObject setContentMinSize: _minSize];
[_realObject setContentMaxSize: _maxSize];

View file

@ -116,7 +116,6 @@ static NSString *ApplicationClass = nil;
@interface NSWindowTemplate5 : NSWindowTemplate
{
BOOL _visibleAtLaunch;
NSToolbar *_toolbar;
}
@end
@ -130,11 +129,8 @@ static NSString *ApplicationClass = nil;
_visibleAtLaunch = YES;
if ([coder containsValueForKey: @"visibleAtLaunch"])
_visibleAtLaunch = [coder decodeBoolForKey: @"visibleAtLaunch"];
if ([coder containsValueForKey: @"NSToolbar"])
{
_toolbar = [coder decodeObjectForKey: @"NSToolbar"];
_visibleAtLaunch = [coder decodeBoolForKey: @"visibleAtLaunch"];
}
}
@ -148,11 +144,6 @@ static NSString *ApplicationClass = nil;
// Instantiate the real object...
[super nibInstantiate];
if (_toolbar)
{
[(NSWindow *)_realObject setToolbar: _toolbar];
}
// >= XIB 5 - startup visible windows...
if (_visibleAtLaunch)
{
@ -635,7 +626,7 @@ static NSArray *XmlBoolDefaultYes = nil;
// The parent of connections array element is the object ID we need...
GSXibElement *parent = [stack objectAtIndex: [stack count] - 1];
NSString *parentId = [parent attributeForKey: @"id"];
NSString *objKey = [@"IBActionConnection5" isEqualToString: [element attributeForKey: @"class"]] ?
NSString *objKey = [@"action" isEqualToString: [element attributeForKey: @"key"]] ?
@"destination" : @"source";
if (parentId == nil)