Removed some compiler warnings and unneeded direct drawing.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23119 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2006-07-02 11:25:04 +00:00
parent 65ba520a1e
commit e2530f9bc8
5 changed files with 26 additions and 19 deletions

View file

@ -1,3 +1,18 @@
2006-07-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTextView.m (-rulerView:didMoveMarker:,
-rulerView:didRemoveMarker:, -rulerView:didAddMarker:): Removed a
compiler warning by adding a type cast.
* Source/NSTextView.m (-initWithCoder:) Removed unused variables.
* Source/NSTextView.m (NSTextViewSharedData -dealloc) Call super dealloc.
* Source/NSApplication.m (-initWithCoder:) Set delegate only when
the keyed decoder contains it.
* Source/NSSlider.m (-trackKnob:knobRect:, mouseDown:) Don't draw
explicitly, as this gets handled automatically by the cell.
* Source/NSOutlineView.m (-editColumn:row:withEvent:select:) Moved
the lockFocus call right around the image cell drawing, as it is
only needed here.
2006-06-25 12:40 Gregory John Casamento <greg_casamento@yahoo.com> 2006-06-25 12:40 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSNibCompatibility.m: Added NSDecimalNumberPlaceholder * Source/GSNibCompatibility.m: Added NSDecimalNumberPlaceholder

View file

@ -3316,8 +3316,8 @@ image.</p><p>See Also: -applicationIconImage</p>
if([aDecoder containsValueForKey: @"NSDelegate"]) if([aDecoder containsValueForKey: @"NSDelegate"])
{ {
obj = [aDecoder decodeObjectForKey: @"NSDelegate"]; obj = [aDecoder decodeObjectForKey: @"NSDelegate"];
[self setDelegate: obj];
} }
[self setDelegate: obj];
obj = [aDecoder decodeObjectForKey: @"NSMainMenu"]; // TODO_NIB: Verify this key!! obj = [aDecoder decodeObjectForKey: @"NSMainMenu"]; // TODO_NIB: Verify this key!!
[self setMainMenu: obj]; [self setMainMenu: obj];
obj = [aDecoder decodeObjectForKey: @"NSWindowsMenu"]; // TODO_NIB: Verify this key!! obj = [aDecoder decodeObjectForKey: @"NSWindowsMenu"]; // TODO_NIB: Verify this key!!

View file

@ -1456,8 +1456,6 @@ static NSImage *unexpandable = nil;
// move the drawing rect over like in the drawRow routine... // move the drawing rect over like in the drawRow routine...
drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex]; drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex];
[self lockFocus];
if (tb == [self outlineTableColumn]) if (tb == [self outlineTableColumn])
{ {
level = [self levelForItem: item]; level = [self levelForItem: item];
@ -1481,7 +1479,10 @@ static NSImage *unexpandable = nil;
// draw... // draw...
imageRect.size.width = [image size].width; imageRect.size.width = [image size].width;
imageRect.size.height = [image size].height; imageRect.size.height = [image size].height;
[self lockFocus];
[imageCell drawWithFrame: imageRect inView: self]; [imageCell drawWithFrame: imageRect inView: self];
[self unlockFocus];
} }
if (flag) if (flag)
@ -1502,7 +1503,6 @@ static NSImage *unexpandable = nil;
event: theEvent]; event: theEvent];
} }
[self unlockFocus];
return; return;
} }

View file

@ -384,8 +384,6 @@ static Class cellClass;
[NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05]; [NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05];
[[NSRunLoop currentRunLoop] limitDateForMode: NSEventTrackingRunLoopMode]; [[NSRunLoop currentRunLoop] limitDateForMode: NSEventTrackingRunLoopMode];
[self lockFocus];
while (eventType != NSLeftMouseUp) while (eventType != NSLeftMouseUp)
{ {
theEvent = [app nextEventMatchingMask: eventMask theEvent = [app nextEventMatchingMask: eventMask
@ -412,8 +410,6 @@ static Class cellClass;
if (floatValue != oldFloatValue) if (floatValue != oldFloatValue)
{ {
[_cell setFloatValue: floatValue]; [_cell setFloatValue: floatValue];
[_cell drawWithFrame: _bounds inView: self];
[_window flushWindow];
if (isContinuous) if (isContinuous)
{ {
[self sendAction: action to: target]; [self sendAction: action to: target];
@ -424,7 +420,7 @@ static Class cellClass;
} }
} }
} }
[self unlockFocus];
// If the control is not continuous send the action at the end of the drag // If the control is not continuous send the action at the end of the drag
if (!isContinuous) if (!isContinuous)
{ {
@ -457,13 +453,10 @@ static Class cellClass;
{ {
[self sendAction: [_cell action] to: [_cell target]]; [self sendAction: [_cell action] to: [_cell target]];
} }
[self lockFocus];
[_cell drawWithFrame: _bounds inView: self];
[self unlockFocus];
[_window flushWindow];
} }
[self trackKnob: theEvent knobRect: rect]; [self trackKnob: theEvent knobRect: rect];
} }
} }
@end @end

View file

@ -171,6 +171,7 @@ Interface for a bunch of internal methods that need to be cleaned up.
RELEASE(linkAttr); RELEASE(linkAttr);
RELEASE(markAttr); RELEASE(markAttr);
RELEASE(selectedAttr); RELEASE(selectedAttr);
[super dealloc];
} }
- (NSColor *)backgroundColor - (NSColor *)backgroundColor
@ -693,8 +694,6 @@ that makes decoding and encoding compatible with the old code.
self = [super initWithCoder: aDecoder]; self = [super initWithCoder: aDecoder];
if ([aDecoder allowsKeyedCoding]) if ([aDecoder allowsKeyedCoding])
{ {
NSTextContainer *aTextContainer;
if ([aDecoder containsValueForKey: @"NSDelegate"]) if ([aDecoder containsValueForKey: @"NSDelegate"])
{ {
[self setDelegate: [aDecoder decodeObjectForKey: @"NSDelegate"]]; [self setDelegate: [aDecoder decodeObjectForKey: @"NSDelegate"]];
@ -764,7 +763,7 @@ that makes decoding and encoding compatible with the old code.
if ([aDecoder containsValueForKey: @"NSTVFlags"]) if ([aDecoder containsValueForKey: @"NSTVFlags"])
{ {
int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"]; //int vFlags = [aDecoder decodeIntForKey: @"NSTVFlags"];
// these flags are not used... // these flags are not used...
} }
@ -3361,7 +3360,7 @@ Figure out how the additional layout stuff is supposed to work.
- (void) rulerView: (NSRulerView *)ruler - (void) rulerView: (NSRulerView *)ruler
didMoveMarker: (NSRulerMarker *)marker didMoveMarker: (NSRulerMarker *)marker
{ {
NSTextTab *old_tab = [marker representedObject]; NSTextTab *old_tab = (NSTextTab *)[marker representedObject];
NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType] NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType]
location: [marker markerLocation]]; location: [marker markerLocation]];
NSRange range = [self rangeForUserParagraphAttributeChange]; NSRange range = [self rangeForUserParagraphAttributeChange];
@ -3430,7 +3429,7 @@ Figure out how the additional layout stuff is supposed to work.
- (void) rulerView: (NSRulerView *)ruler - (void) rulerView: (NSRulerView *)ruler
didRemoveMarker: (NSRulerMarker *)marker didRemoveMarker: (NSRulerMarker *)marker
{ {
NSTextTab *tab = [marker representedObject]; NSTextTab *tab = (NSTextTab *)[marker representedObject];
NSRange range = [self rangeForUserParagraphAttributeChange]; NSRange range = [self rangeForUserParagraphAttributeChange];
unsigned loc = range.location; unsigned loc = range.location;
NSParagraphStyle *style; NSParagraphStyle *style;
@ -3489,7 +3488,7 @@ Figure out how the additional layout stuff is supposed to work.
- (void) rulerView: (NSRulerView *)ruler - (void) rulerView: (NSRulerView *)ruler
didAddMarker: (NSRulerMarker *)marker didAddMarker: (NSRulerMarker *)marker
{ {
NSTextTab *old_tab = [marker representedObject]; NSTextTab *old_tab = (NSTextTab *)[marker representedObject];
NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType] NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType]
location: [marker markerLocation]]; location: [marker markerLocation]];
NSRange range = [self rangeForUserParagraphAttributeChange]; NSRange range = [self rangeForUserParagraphAttributeChange];