Skip to content

Commit

Permalink
Merge branch 'master' into NSBrowser_bindings_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Aug 29, 2024
2 parents 12e4eaa + 530dee1 commit 83958c1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-08-29 Gregory John Casamento <greg.casamento@gmail.com>

* Source/NSBundleAdditions.m: Quick fix for .gorm loading
not returning top level objects.

2024-08-18 Gregory John Casamento <greg.casamento@gmail.com>

* Headers/AppKit/NSTreeController.h: Update header
Expand Down
26 changes: 24 additions & 2 deletions Source/NSBundleAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,30 @@ - (BOOL) loadNibNamed: (NSString *)aNibName

if (owner != nil && aNibName != nil)
{
NSDictionary *table = [NSDictionary dictionaryWithObject: owner forKey: NSNibOwner];

NSDictionary *table = nil;
NSMutableArray *tlo = nil;

// Based on the arguments above, set up the table appropriately...
if (owner != nil)
{
if (topLevelObjects != NULL)
{
// Here we initialize the array, it is sent in using the dictionary.
// In the code below it is pulled back out and assigned to the
// reference in the arguments.
tlo = [NSMutableArray array];
table = [NSDictionary dictionaryWithObjectsAndKeys:
owner, NSNibOwner,
tlo, NSNibTopLevelObjects,
nil];
}
else
{
table = [NSDictionary dictionaryWithObject: owner forKey: NSNibOwner];
}
}

// Attempt to load the model file...
success = [self loadNibFile: aNibName
externalNameTable: table
withZone: [owner zone]];
Expand Down
2 changes: 1 addition & 1 deletion Source/NSNib.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ - (BOOL) instantiateNibWithOwner: (id)owner
// add the necessary things to the table...
[externalNameTable setObject: owner forKey: NSNibOwner];

if (topLevelObjects != 0)
if (topLevelObjects != NULL)
{
*topLevelObjects = [NSMutableArray array];
[externalNameTable setObject: *topLevelObjects
Expand Down

0 comments on commit 83958c1

Please sign in to comment.