diff --git a/ChangeLog b/ChangeLog index c311d66b3..ff8e8f25d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-08-07 Fred Kiefer + + * Source/NSButtonCell.m (-initWithCoder:), + * Source/NSMenuItem.m (-initWithCoder:): Adopt to changed values + for _keyEquivalentModifierMask. These have changed through the + NSEvent.h change. + 2007-08-03 Fred Kiefer * Source/NSView.m (-displayIfNeededInRectIgnoringOpacity:): diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 3a6c99920..1cd9bc6ea 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -113,7 +113,7 @@ typedef struct _GSButtonCellFlags + (void) initialize { if (self == [NSButtonCell class]) - [self setVersion: 2]; + [self setVersion: 3]; } /* @@ -1739,6 +1739,7 @@ typedef struct _GSButtonCellFlags else { BOOL tmp; + int version = [aDecoder versionForClassName: @"NSButtonCell"]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalent]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalentFont]; @@ -1748,13 +1749,17 @@ typedef struct _GSButtonCellFlags _buttoncell_is_transparent = tmp; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_keyEquivalentModifierMask]; + if (version <= 2) + { + _keyEquivalentModifierMask = _keyEquivalentModifierMask << 16; + } [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_highlightsByMask]; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_showAltStateMask]; - if ([aDecoder versionForClassName: @"NSButtonCell"] >= 2) - { + if (version >= 2) + { [aDecoder decodeValueOfObjCType: @encode(id) at: &_sound]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_backgroundColor]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_delayInterval]; @@ -1767,7 +1772,7 @@ typedef struct _GSButtonCellFlags _image_dims_when_disabled = tmp; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _shows_border_only_while_mouse_inside = tmp; - } + } } return self; } diff --git a/Source/NSMenuItem.m b/Source/NSMenuItem.m index 990a8c34f..a9e66638c 100644 --- a/Source/NSMenuItem.m +++ b/Source/NSMenuItem.m @@ -73,7 +73,7 @@ static Class imageClass; { if (self == [NSMenuItem class]) { - [self setVersion: 3]; + [self setVersion: 4]; imageClass = [NSImage class]; } } @@ -552,19 +552,19 @@ static Class imageClass; if ([aDecoder containsValueForKey: @"NSKeyEquivModMask"]) { - int keyMask = [aDecoder decodeIntForKey: @"NSKeyEquivModMask"]; - [self setKeyEquivalentModifierMask: keyMask]; - } + int keyMask = [aDecoder decodeIntForKey: @"NSKeyEquivModMask"]; + [self setKeyEquivalentModifierMask: keyMask]; + } if ([aDecoder containsValueForKey: @"NSMnemonicLoc"]) { - int loc = [aDecoder decodeIntForKey: @"NSMnemonicLoc"]; - [self setMnemonicLocation: loc]; - } + int loc = [aDecoder decodeIntForKey: @"NSMnemonicLoc"]; + [self setMnemonicLocation: loc]; + } if ([aDecoder containsValueForKey: @"NSState"]) { - int state = [aDecoder decodeIntForKey: @"NSState"]; - [self setState: state]; - } + int state = [aDecoder decodeIntForKey: @"NSState"]; + [self setState: state]; + } } else { @@ -574,6 +574,10 @@ static Class imageClass; [aDecoder decodeValueOfObjCType: @encode(id) at: &_title]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalent]; [aDecoder decodeValueOfObjCType: "I" at: &_keyEquivalentModifierMask]; + if (version <= 3) + { + _keyEquivalentModifierMask = _keyEquivalentModifierMask << 16; + } [aDecoder decodeValueOfObjCType: "I" at: &_mnemonicLocation]; [aDecoder decodeValueOfObjCType: "i" at: &_state]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled]; @@ -584,22 +588,22 @@ static Class imageClass; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_changesState]; if (version == 1) { - _target = [aDecoder decodeObject]; - } + _target = [aDecoder decodeObject]; + } [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; [aDecoder decodeValueOfObjCType: "i" at: &_tag]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_representedObject]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_submenu]; if (version >= 2) { - _target = [aDecoder decodeObject]; - } - if (version == 3) + _target = [aDecoder decodeObject]; + } + if (version >= 3) { - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isAlternate]; - [aDecoder decodeValueOfObjCType: @encode(char) at: &_indentation]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_toolTip]; - } + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isAlternate]; + [aDecoder decodeValueOfObjCType: @encode(char) at: &_indentation]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &_toolTip]; + } } return self;