* Source/NSSliderCell.m: Fix encoding/decoding as the types don't match.

* Source/NSApplication.m (-targetForAction:to:from:): Warn only in
debug mode about the target not responding to the action.
This commit is contained in:
fredkiefer 2019-07-28 20:12:26 +02:00
parent 1e05899a0f
commit 5756e5f396
3 changed files with 20 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2019-07-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSSliderCell.m: Fix encoding/decoding as the types don't match.
* Source/NSApplication.m (-targetForAction:to:from:): Warn only in
debug mode about the target not responding to the action.
2019-07-07 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSColor.h,

View file

@ -2297,7 +2297,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
}
else
{
NSLog(@"Target %@ does not respont to action %@", theTarget, NSStringFromSelector(theAction));
NSDebugLog(@"Target %@ does not respont to action %@", theTarget, NSStringFromSelector(theAction));
return nil;
}
}

View file

@ -1070,10 +1070,16 @@ double _doubleValueForMousePoint (NSPoint point, NSRect knobRect,
else
{
float minValue, maxValue;
float altIncrementValue;
int isVertical;
[decoder decodeValuesOfObjCTypes: "fffi",
&minValue, &maxValue, &_altIncrementValue, &_isVertical];
&minValue, &maxValue, &altIncrementValue, &isVertical];
[self setDoubleValue: 0];
[self setMinValue: minValue];
[self setMaxValue: maxValue];
[self setAltIncrementValue: altIncrementValue];
_isVertical = isVertical;
[decoder decodeValueOfObjCType: @encode(id) at: &_titleCell];
[decoder decodeValueOfObjCType: @encode(id) at: &_knobCell];
if ([decoder versionForClassName: @"NSSliderCell"] >= 2)
@ -1102,8 +1108,13 @@ double _doubleValueForMousePoint (NSPoint point, NSRect knobRect,
}
else
{
float minValue = _minValue;
float maxValue = _maxValue;
float altIncrementValue = _altIncrementValue;
int isVertical = _isVertical;
[coder encodeValuesOfObjCTypes: "fffi",
&_minValue, &_maxValue, &_altIncrementValue, &_isVertical];
&minValue, &maxValue, &altIncrementValue, &isVertical];
[coder encodeValueOfObjCType: @encode(id) at: &_titleCell];
[coder encodeValueOfObjCType: @encode(id) at: &_knobCell];
// New for version 2