Properly retain/release the sound; indentation fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2002-04-02 11:38:45 +00:00
parent eda67fbdab
commit 2b1890db9e

View file

@ -111,6 +111,7 @@
RELEASE(_altImage); RELEASE(_altImage);
RELEASE(_keyEquivalent); RELEASE(_keyEquivalent);
RELEASE(_keyEquivalentFont); RELEASE(_keyEquivalentFont);
RELEASE(_sound);
[super dealloc]; [super dealloc];
} }
@ -217,8 +218,12 @@
ASSIGNCOPY(_altContents, aString); ASSIGNCOPY(_altContents, aString);
if (_control_view) if (_control_view)
if ([_control_view isKindOfClass: [NSControl class]]) {
[(NSControl*)_control_view updateCell: self]; if ([_control_view isKindOfClass: [NSControl class]])
{
[(NSControl*)_control_view updateCell: self];
}
}
} }
- (NSAttributedString *)attributedAlternateTitle - (NSAttributedString *)attributedAlternateTitle
@ -855,20 +860,30 @@
* The following code must be kept in sync with -drawInteriorWithFrame * The following code must be kept in sync with -drawInteriorWithFrame
*/ */
if (_cell.is_highlighted) if (_cell.is_highlighted)
mask = _highlightsByMask; {
mask = _highlightsByMask;
}
else if (_cell.state) else if (_cell.state)
mask = _showAltStateMask; {
mask = _showAltStateMask;
}
else else
mask = NSNoCellMask; {
mask = NSNoCellMask;
}
if (mask & NSContentsCellMask) if (mask & NSContentsCellMask)
{ {
imageToDisplay = _altImage; imageToDisplay = _altImage;
if (!imageToDisplay) if (!imageToDisplay)
imageToDisplay = _cell_image; {
imageToDisplay = _cell_image;
}
titleToDisplay = _altContents; titleToDisplay = _altContents;
if (titleToDisplay == nil || [titleToDisplay isEqual: @""]) if (titleToDisplay == nil || [titleToDisplay isEqual: @""])
titleToDisplay = _contents; {
titleToDisplay = _contents;
}
} }
else else
{ {
@ -877,10 +892,14 @@
} }
if (imageToDisplay) if (imageToDisplay)
imageSize = [imageToDisplay size]; {
else imageSize = [imageToDisplay size];
imageSize = NSZeroSize; }
else
{
imageSize = NSZeroSize;
}
if (titleToDisplay != nil) if (titleToDisplay != nil)
{ {
titleSize = [self _sizeText: titleToDisplay]; titleSize = [self _sizeText: titleToDisplay];
@ -970,12 +989,14 @@
theRect.size.height - 3.); theRect.size.height - 3.);
} }
else else
return theRect; {
return theRect;
}
} }
- (void)setSound:(NSSound *)aSound - (void)setSound: (NSSound *)aSound
{ {
_sound = aSound; ASSIGN(_sound, aSound);
} }
- (NSSound *)sound - (NSSound *)sound