mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +00:00
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:
parent
baefb4a5ac
commit
2505fd4eab
3 changed files with 37 additions and 7 deletions
|
@ -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>
|
2008-12-07 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSTextView.m (-mouseDown:): Start drag operation only
|
* Source/NSTextView.m (-mouseDown:): Start drag operation only
|
||||||
|
|
|
@ -180,6 +180,10 @@
|
||||||
NSAffineTransform *transform;
|
NSAffineTransform *transform;
|
||||||
NSAffineTransformStruct ts;
|
NSAffineTransformStruct ts;
|
||||||
|
|
||||||
|
// Is there anything to draw?
|
||||||
|
if (NSIsEmptyRect(_rect))
|
||||||
|
return YES;
|
||||||
|
|
||||||
transform = [ctxt GSCurrentCTM];
|
transform = [ctxt GSCurrentCTM];
|
||||||
ts = [transform transformStruct];
|
ts = [transform transformStruct];
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,10 @@
|
||||||
|
|
||||||
- (id) initWithWindowNibName: (NSString *)windowNibName
|
- (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)
|
if (windowNibName == nil)
|
||||||
{
|
{
|
||||||
|
@ -68,13 +68,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
self = [self initWithWindow: nil];
|
self = [self initWithWindow: nil];
|
||||||
|
if (!self)
|
||||||
|
return nil;
|
||||||
|
|
||||||
ASSIGN(_window_nib_name, windowNibName);
|
ASSIGN(_window_nib_name, windowNibName);
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithWindowNibPath: (NSString *)windowNibPath
|
- (id) initWithWindowNibPath: (NSString *)windowNibPath
|
||||||
owner: (id)owner
|
owner: (id)owner
|
||||||
{
|
{
|
||||||
if (windowNibPath == nil)
|
if (windowNibPath == nil)
|
||||||
{
|
{
|
||||||
|
@ -89,6 +92,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
self = [self initWithWindow: nil];
|
self = [self initWithWindow: nil];
|
||||||
|
if (!self)
|
||||||
|
return nil;
|
||||||
|
|
||||||
ASSIGN(_window_nib_path, windowNibPath);
|
ASSIGN(_window_nib_path, windowNibPath);
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
return self;
|
return self;
|
||||||
|
@ -97,10 +103,12 @@
|
||||||
- (id) initWithWindow: (NSWindow *)window
|
- (id) initWithWindow: (NSWindow *)window
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
if (!self)
|
||||||
|
return nil;
|
||||||
|
|
||||||
_window_frame_autosave_name = @"";
|
ASSIGN(_window_frame_autosave_name, @"");
|
||||||
_wcFlags.should_cascade = YES;
|
_wcFlags.should_cascade = YES;
|
||||||
_wcFlags.should_close_document = NO;
|
//_wcFlags.should_close_document = NO;
|
||||||
|
|
||||||
[self setWindow: window];
|
[self setWindow: window];
|
||||||
if (_window != nil)
|
if (_window != nil)
|
||||||
|
@ -484,9 +492,18 @@
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue