mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 08:20:49 +00:00
Fixed different issues spotted by the static code analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32477 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
82471b45fc
commit
68456da582
5 changed files with 74 additions and 23 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2011-03-06 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSMatrix.m (-_privateFrame:...numberOfColumns): Change
|
||||||
|
the init helper method to conform with the Objective-C conventions,
|
||||||
|
* Source/GSGormLoading.m (GSNibItem-initWithCoder:): Retain the
|
||||||
|
shared application before returning it.
|
||||||
|
* Source/NSDataLink.m: Correct the init methods to return a
|
||||||
|
retained object.
|
||||||
|
* Source/NSAnimation.m: Implement the copy and coding methods.
|
||||||
|
Fixed issues spotted by the static code analysis.
|
||||||
|
|
||||||
2011-03-05 Richard Frith-Macdonald <rfm@gnu.org>
|
2011-03-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSHelpManager.m:
|
* Source/NSHelpManager.m:
|
||||||
|
|
|
@ -546,7 +546,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
{
|
{
|
||||||
if(GSObjCIsKindOf(cls, [NSApplication class]))
|
if(GSObjCIsKindOf(cls, [NSApplication class]))
|
||||||
{
|
{
|
||||||
obj = [cls sharedApplication];
|
obj = RETAIN([cls sharedApplication]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -445,7 +445,13 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone*)zone
|
- (id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
return [self notImplemented: _cmd];
|
NSAnimation *c = (NSAnimation*)NSCopyObject (self, 0, zone);
|
||||||
|
|
||||||
|
c->_progressMarks = GSIArrayCopyWithZone(_progressMarks, zone);
|
||||||
|
c->_animator = nil;
|
||||||
|
c->_isANewAnimatorNeeded = YES;
|
||||||
|
c->_isAnimatingLock = [GSLazyRecursiveLock new];
|
||||||
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -910,14 +916,44 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
|
||||||
_NSANIMATION_UNLOCK;
|
_NSANIMATION_UNLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) encodeWithCoder: (NSCoder*)coder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
[self notImplemented: _cmd];
|
if ([aCoder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
[aCoder encodeInt: (int)[self animationCurve]
|
||||||
|
forKey: @"NSAnimationAnimationCurve"];
|
||||||
|
[aCoder encodeDouble: [self duration]
|
||||||
|
forKey: @"NSAnimationDuration"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self notImplemented: _cmd];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)coder
|
- (id) initWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
return [self notImplemented: _cmd];
|
if ([aCoder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
NSTimeInterval duration = 1.0;
|
||||||
|
NSAnimationCurve animationCurve = 0;
|
||||||
|
|
||||||
|
if ([aCoder containsValueForKey: @"NSAnimationAnimationCurve"])
|
||||||
|
{
|
||||||
|
animationCurve = [aCoder decodeIntForKey: @"NSAnimationAnimationCurve"];
|
||||||
|
}
|
||||||
|
if ([aCoder containsValueForKey: @"NSAnimationDuration"])
|
||||||
|
{
|
||||||
|
duration = [aCoder decodeDoubleForKey: @"NSAnimationDuration"];
|
||||||
|
}
|
||||||
|
return [self initWithDuration: duration
|
||||||
|
animationCurve: animationCurve];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self notImplemented: _cmd];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
NSSelection *selection = [NSSelection selectionWithDescriptionData: data];
|
NSSelection *selection = [NSSelection selectionWithDescriptionData: data];
|
||||||
ASSIGN(sourceSelection, selection);
|
ASSIGN(sourceSelection, selection);
|
||||||
}
|
}
|
||||||
return nil;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initLinkedToSourceSelection:(NSSelection *)selection
|
- (id)initLinkedToSourceSelection:(NSSelection *)selection
|
||||||
|
@ -82,18 +82,21 @@
|
||||||
|
|
||||||
- (id)initWithContentsOfFile:(NSString *)filename
|
- (id)initWithContentsOfFile:(NSString *)filename
|
||||||
{
|
{
|
||||||
NSData *data = AUTORELEASE([[NSData alloc] initWithContentsOfFile: filename]);
|
NSData *data = [[NSData alloc] initWithContentsOfFile: filename];
|
||||||
id object = [NSUnarchiver unarchiveObjectWithData: data];
|
id object = [NSUnarchiver unarchiveObjectWithData: data];
|
||||||
|
|
||||||
|
RELEASE(data);
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
return object;
|
return RETAIN(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithPasteboard:(NSPasteboard *)pasteboard
|
- (id)initWithPasteboard:(NSPasteboard *)pasteboard
|
||||||
{
|
{
|
||||||
NSData *data = [pasteboard dataForType: NSDataLinkPboardType];
|
NSData *data = [pasteboard dataForType: NSDataLinkPboardType];
|
||||||
id object = [NSUnarchiver unarchiveObjectWithData: data];
|
id object = [NSUnarchiver unarchiveObjectWithData: data];
|
||||||
|
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
return object;
|
return RETAIN(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -262,10 +262,10 @@ static SEL getSel;
|
||||||
numberOfColumns: 0];
|
numberOfColumns: 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) _privateFrame: (NSRect)frameRect
|
- (void) _privateFrame: (NSRect)frameRect
|
||||||
mode: (int)aMode
|
mode: (int)aMode
|
||||||
numberOfRows: (int)rows
|
numberOfRows: (int)rows
|
||||||
numberOfColumns: (int)cols
|
numberOfColumns: (int)cols
|
||||||
{
|
{
|
||||||
_myZone = [self zone];
|
_myZone = [self zone];
|
||||||
[self _renewRows: rows columns: cols rowSpace: 0 colSpace: 0];
|
[self _renewRows: rows columns: cols rowSpace: 0 colSpace: 0];
|
||||||
|
@ -327,7 +327,6 @@ static SEL getSel;
|
||||||
_selectedCell = nil;
|
_selectedCell = nil;
|
||||||
_selectedRow = _selectedColumn = -1;
|
_selectedRow = _selectedColumn = -1;
|
||||||
}
|
}
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**<p>Initializes and returns a new NSMatrix in the specified frame frameRect.
|
/**<p>Initializes and returns a new NSMatrix in the specified frame frameRect.
|
||||||
|
@ -346,10 +345,11 @@ static SEL getSel;
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
[self setCellClass: classId];
|
[self setCellClass: classId];
|
||||||
return [self _privateFrame: frameRect
|
[self _privateFrame: frameRect
|
||||||
mode: aMode
|
mode: aMode
|
||||||
numberOfRows: rowsHigh
|
numberOfRows: rowsHigh
|
||||||
numberOfColumns: colsWide];
|
numberOfColumns: colsWide];
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**<p>Initializes and returns a new NSMatrix in the specified frame frameRect.
|
/**<p>Initializes and returns a new NSMatrix in the specified frame frameRect.
|
||||||
|
@ -368,10 +368,11 @@ static SEL getSel;
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
[self setPrototype: aCell];
|
[self setPrototype: aCell];
|
||||||
return [self _privateFrame: frameRect
|
[self _privateFrame: frameRect
|
||||||
mode: aMode
|
mode: aMode
|
||||||
numberOfRows: rowsHigh
|
numberOfRows: rowsHigh
|
||||||
numberOfColumns: colsWide];
|
numberOfColumns: colsWide];
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue