mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Protect against knob image being nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22251 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9bb51c5a9d
commit
ef9e46d09d
2 changed files with 48 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
|||
2006-01-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSSliderCell.m (-knobRectFlipped,-knobThickness
|
||||
-drawInteriorWithFrame:inView:, -setKnobThickness:): Protect against knob
|
||||
image being nil. Fixes Solaris problem reported by <ubossx@gmail.com>.
|
||||
|
||||
2005-12-31 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* Source/NSTableView.m (-mouseDown:): Copy the selected cell before
|
||||
|
|
|
@ -136,7 +136,14 @@ DEFINE_RINT_IF_MISSING
|
|||
|
||||
floatValue = (floatValue - _minValue) / (_maxValue - _minValue);
|
||||
|
||||
size = [image size];
|
||||
if (image != nil)
|
||||
{
|
||||
size = [image size];
|
||||
}
|
||||
else
|
||||
{
|
||||
size = NSZeroSize;
|
||||
}
|
||||
|
||||
if (_isVertical == YES)
|
||||
{
|
||||
|
@ -190,16 +197,22 @@ DEFINE_RINT_IF_MISSING
|
|||
if (vertical == YES)
|
||||
{
|
||||
image = [NSImage imageNamed: @"common_SliderVert"];
|
||||
size = [image size];
|
||||
[image setScalesWhenResized:YES];
|
||||
[image setSize: NSMakeSize (cellFrame.size.width, size.height)];
|
||||
if (image != nil)
|
||||
{
|
||||
size = [image size];
|
||||
[image setScalesWhenResized: YES];
|
||||
[image setSize: NSMakeSize(cellFrame.size.width, size.height)];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image = [NSImage imageNamed: @"common_SliderHoriz"];
|
||||
size = [image size];
|
||||
[image setScalesWhenResized:YES];
|
||||
[image setSize: NSMakeSize (size.width, cellFrame.size.height)];
|
||||
if (image != nil)
|
||||
{
|
||||
size = [image size];
|
||||
[image setScalesWhenResized: YES];
|
||||
[image setSize: NSMakeSize(size.width, cellFrame.size.height)];
|
||||
}
|
||||
}
|
||||
[_knobCell setImage: image];
|
||||
}
|
||||
|
@ -230,8 +243,17 @@ DEFINE_RINT_IF_MISSING
|
|||
*/
|
||||
- (float) knobThickness
|
||||
{
|
||||
NSImage *image = [_knobCell image];
|
||||
NSSize size = [image size];
|
||||
NSImage *image = [_knobCell image];
|
||||
NSSize size;
|
||||
|
||||
if (image != nil)
|
||||
{
|
||||
size = [image size];
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _isVertical ? size.height : size.width;
|
||||
}
|
||||
|
@ -242,8 +264,17 @@ DEFINE_RINT_IF_MISSING
|
|||
*/
|
||||
- (void) setKnobThickness: (float)thickness
|
||||
{
|
||||
NSImage *image = [_knobCell image];
|
||||
NSSize size = [image size];
|
||||
NSImage *image = [_knobCell image];
|
||||
NSSize size;
|
||||
|
||||
if (image != nil)
|
||||
{
|
||||
size = [image size];
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isVertical == YES)
|
||||
size.height = thickness;
|
||||
|
|
Loading…
Reference in a new issue