mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 09:31:19 +00:00
Fix bugs found by static code analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31360 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
828a34fa04
commit
33899b229d
2 changed files with 27 additions and 36 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2010-09-16 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSView.m (-resizeWithOldSuperviewSize): Remove unneeded
|
||||||
|
local varibales.
|
||||||
|
* Source/NSView.m (-bitmapImageRepForCachingDisplayInRect:):
|
||||||
|
Create the image rep with [-initWithFocusedViewRect:], that way it
|
||||||
|
will better map to the following -cacheDisplayInRect:... call.
|
||||||
|
Also don't leak the image.
|
||||||
|
* Source/NSView.m (-cacheDisplayInRect:...): Don't leak the image
|
||||||
|
rep.
|
||||||
|
* Source/NSView.m (-_subtreeDescriptionWithPrefix:): Don't leak
|
||||||
|
the returned string.
|
||||||
|
|
||||||
2010-09-15 German Arias <german@xelalug.org>
|
2010-09-15 German Arias <german@xelalug.org>
|
||||||
* Panels/Spanish.lproj/GSPrintPanel.gorm: Changed the width
|
* Panels/Spanish.lproj/GSPrintPanel.gorm: Changed the width
|
||||||
of a label.
|
of a label.
|
||||||
|
@ -60,7 +73,6 @@
|
||||||
* Source/GSToolbarCustomizationPalette.m
|
* Source/GSToolbarCustomizationPalette.m
|
||||||
(-paletteItemsWithToolbarItems:): Release the copied toolbar items.
|
(-paletteItemsWithToolbarItems:): Release the copied toolbar items.
|
||||||
|
|
||||||
>>>>>>> .r31351
|
|
||||||
2010-09-09 Eric Wasylishen <ewasylishen@gmail.com>
|
2010-09-09 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/GSTheme.m:
|
* Source/GSTheme.m:
|
||||||
|
|
|
@ -475,7 +475,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
[desc appendString: [v _subtreeDescriptionWithPrefix: prefix]];
|
[desc appendString: [v _subtreeDescriptionWithPrefix: prefix]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return desc;
|
return AUTORELEASE(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1886,8 +1886,6 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
int options = 0;
|
int options = 0;
|
||||||
NSSize superViewFrameSize;
|
NSSize superViewFrameSize;
|
||||||
NSRect newFrame = _frame;
|
NSRect newFrame = _frame;
|
||||||
BOOL changedOrigin = NO;
|
|
||||||
BOOL changedSize = NO;
|
|
||||||
|
|
||||||
if (_autoresizingMask == NSViewNotSizable)
|
if (_autoresizingMask == NSViewNotSizable)
|
||||||
return;
|
return;
|
||||||
|
@ -1919,12 +1917,10 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
if (_autoresizingMask & NSViewWidthSizable)
|
if (_autoresizingMask & NSViewWidthSizable)
|
||||||
{
|
{
|
||||||
newFrame.size.width += changePerOption;
|
newFrame.size.width += changePerOption;
|
||||||
changedSize = YES;
|
|
||||||
}
|
}
|
||||||
if (_autoresizingMask & NSViewMinXMargin)
|
if (_autoresizingMask & NSViewMinXMargin)
|
||||||
{
|
{
|
||||||
newFrame.origin.x += changePerOption;
|
newFrame.origin.x += changePerOption;
|
||||||
changedOrigin = YES;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1952,7 +1948,6 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
if (_autoresizingMask & NSViewHeightSizable)
|
if (_autoresizingMask & NSViewHeightSizable)
|
||||||
{
|
{
|
||||||
newFrame.size.height += changePerOption;
|
newFrame.size.height += changePerOption;
|
||||||
changedSize = YES;
|
|
||||||
}
|
}
|
||||||
if (_autoresizingMask & (NSViewMaxYMargin | NSViewMinYMargin))
|
if (_autoresizingMask & (NSViewMaxYMargin | NSViewMinYMargin))
|
||||||
{
|
{
|
||||||
|
@ -1961,7 +1956,6 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
if (_autoresizingMask & NSViewMaxYMargin)
|
if (_autoresizingMask & NSViewMaxYMargin)
|
||||||
{
|
{
|
||||||
newFrame.origin.y += changePerOption;
|
newFrame.origin.y += changePerOption;
|
||||||
changedOrigin = YES;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1969,11 +1963,11 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
if (_autoresizingMask & NSViewMinYMargin)
|
if (_autoresizingMask & NSViewMinYMargin)
|
||||||
{
|
{
|
||||||
newFrame.origin.y += changePerOption;
|
newFrame.origin.y += changePerOption;
|
||||||
changedOrigin = YES;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[self setFrame: newFrame];
|
[self setFrame: newFrame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2622,31 +2616,12 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
- (NSBitmapImageRep *) bitmapImageRepForCachingDisplayInRect: (NSRect)rect
|
- (NSBitmapImageRep *) bitmapImageRepForCachingDisplayInRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
NSBitmapImageRep *bitmap;
|
NSBitmapImageRep *bitmap;
|
||||||
NSDictionary *dict;
|
|
||||||
int bps, spp, alpha;
|
|
||||||
NSString *space;
|
|
||||||
|
|
||||||
dict = [_window deviceDescription];
|
[self lockFocus];
|
||||||
bps = [[dict objectForKey: NSDeviceBitsPerSample] intValue];
|
bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect];
|
||||||
if (bps == 0)
|
[self unlockFocus];
|
||||||
bps = 8;
|
|
||||||
// spp = [[dict objectForKey: @"SamplesPerPixel"] intValue];
|
|
||||||
spp = 4;
|
|
||||||
// alpha = [[dict objectForKey: @"HasAlpha"] intValue];
|
|
||||||
alpha = 1;
|
|
||||||
space = [dict objectForKey: NSDeviceColorSpaceName];
|
|
||||||
|
|
||||||
bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL
|
return AUTORELEASE(bitmap);
|
||||||
pixelsWide: rect.size.width
|
|
||||||
pixelsHigh: rect.size.height
|
|
||||||
bitsPerSample: bps
|
|
||||||
samplesPerPixel: spp
|
|
||||||
hasAlpha: (alpha) ? YES : NO
|
|
||||||
isPlanar: NO
|
|
||||||
colorSpaceName: space
|
|
||||||
bytesPerRow: 0
|
|
||||||
bitsPerPixel: 0];
|
|
||||||
return bitmap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) cacheDisplayInRect: (NSRect)rect
|
- (void) cacheDisplayInRect: (NSRect)rect
|
||||||
|
@ -2658,10 +2633,14 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1,
|
||||||
[self lockFocus];
|
[self lockFocus];
|
||||||
dict = [GSCurrentContext() GSReadRect: rect];
|
dict = [GSCurrentContext() GSReadRect: rect];
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
imageData = RETAIN([dict objectForKey: @"Data"]);
|
imageData = [dict objectForKey: @"Data"];
|
||||||
// FIXME: Copy the image data to the bitmap
|
|
||||||
|
if (imageData != nil)
|
||||||
|
{
|
||||||
|
// Copy the image data to the bitmap
|
||||||
memcpy([bitmap bitmapData], [imageData bytes], [imageData length]);
|
memcpy([bitmap bitmapData], [imageData bytes], [imageData length]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern NSThread *GSAppKitThread; /* TODO */
|
extern NSThread *GSAppKitThread; /* TODO */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue