From 1ad7d1834ee205631e202bb4651b077846e6dc81 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Wed, 27 Nov 2024 17:12:15 -0500 Subject: [PATCH] Set pullsDown last to avoid accidentally setting state --- Source/NSPopUpButtonCell.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 3b98e6719..b02fd6f24 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -654,7 +654,6 @@ - (void) setMenuItem: (NSMenuItem *)item [_menuItem setImage: nil]; } - //[super setMenuItem: item]; ASSIGN(_menuItem, item); if ([_menuItem image] == nil) @@ -1321,7 +1320,7 @@ - (id) initWithCoder: (NSCoder*)aDecoder } else { - NSInteger flag; + NSInteger flag, pullsDown; id selectedItem; int version = [aDecoder versionForClassName: @"NSPopUpButtonCell"]; @@ -1336,8 +1335,7 @@ - (id) initWithCoder: (NSCoder*)aDecoder [self setMenu: nil]; [self setMenu: menu]; selectedItem = [aDecoder decodeObject]; - decode_NSInteger(aDecoder, &flag); - [self setPullsDown: flag]; + decode_NSInteger(aDecoder, &pullsDown); decode_NSInteger(aDecoder, &flag); [self setPreferredEdge: flag]; decode_NSInteger(aDecoder, &flag); @@ -1347,6 +1345,7 @@ - (id) initWithCoder: (NSCoder*)aDecoder decode_NSInteger(aDecoder, &flag); [self setArrowPosition: flag]; [self setMenuItem: (NSMenuItem *)selectedItem]; + [self setPullsDown: pullsDown]; if (version < 2) {