Made all initialisation methods on NSWindowController a bit safer. Solves bug #25004.

Don't draw an empty rect in NSCachedImageRep. Fixes the remaining issue of #22282.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-12-07 21:22:13 +00:00
parent aeec5f704c
commit 25353583be
3 changed files with 37 additions and 7 deletions

View file

@ -1,3 +1,12 @@
2008-12-07 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindowController.m (-initWithWindow:,
-initWithWindowNibPath:owner:, -initWithWindowNibName:owner:,
-initWithCoder:): Made all initialisation methods a bit safer.
Solves bug #25004.
* Source/NSCachedImageRep.m(-draw): Don't draw an empty
rect. Fixes the remaining issue of #22282.
2008-12-07 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView.m (-mouseDown:): Start drag operation only

View file

@ -180,6 +180,10 @@
NSAffineTransform *transform;
NSAffineTransformStruct ts;
// Is there anything to draw?
if (NSIsEmptyRect(_rect))
return YES;
transform = [ctxt GSCurrentCTM];
ts = [transform transformStruct];

View file

@ -50,10 +50,10 @@
- (id) initWithWindowNibName: (NSString *)windowNibName
{
return [self initWithWindowNibName: windowNibName owner: self];
return [self initWithWindowNibName: windowNibName owner: self];
}
- (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner
- (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner
{
if (windowNibName == nil)
{
@ -68,13 +68,16 @@
}
self = [self initWithWindow: nil];
if (!self)
return nil;
ASSIGN(_window_nib_name, windowNibName);
_owner = owner;
return self;
}
- (id) initWithWindowNibPath: (NSString *)windowNibPath
owner: (id)owner
owner: (id)owner
{
if (windowNibPath == nil)
{
@ -89,6 +92,9 @@
}
self = [self initWithWindow: nil];
if (!self)
return nil;
ASSIGN(_window_nib_path, windowNibPath);
_owner = owner;
return self;
@ -97,10 +103,12 @@
- (id) initWithWindow: (NSWindow *)window
{
self = [super init];
if (!self)
return nil;
_window_frame_autosave_name = @"";
ASSIGN(_window_frame_autosave_name, @"");
_wcFlags.should_cascade = YES;
_wcFlags.should_close_document = NO;
//_wcFlags.should_close_document = NO;
[self setWindow: window];
if (_window != nil)
@ -484,9 +492,18 @@
- (id) initWithCoder: (NSCoder *)coder
{
if ([coder versionForClassName: @"NSWindowController"] >= 1)
if ([coder allowsKeyedCoding]
|| [coder versionForClassName: @"NSWindowController"] >= 1)
{
return [super initWithCoder: coder];
self = [super initWithCoder: coder];
if (!self)
return nil;
ASSIGN(_window_frame_autosave_name, @"");
_wcFlags.should_cascade = YES;
//_wcFlags.should_close_document = NO;
return self;
}
else
{