From 2f3da79d3029a7907185877d54303e26f6f80cce Mon Sep 17 00:00:00 2001 From: gcasa Date: Fri, 14 Jan 2005 14:24:57 +0000 Subject: [PATCH] Corrected undo in nsdocument. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20553 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSDocument.m | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 827b92d26..78cd72872 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-14 09:25 Gregory John Casamento + + * Source/NSDocument.m: Minor change. The init method now sets the + flag to YES so that when a undoManager is needed, it's instantiated. + 2005-01-14 05:50 Gregory John Casamento * Source/NSDocument.m: corrected undoManager call in NSDocument. diff --git a/Source/NSDocument.m b/Source/NSDocument.m index ddbb2feb7..4c075b569 100644 --- a/Source/NSDocument.m +++ b/Source/NSDocument.m @@ -71,6 +71,7 @@ _documentIndex = untitledCount++; _windowControllers = [[NSMutableArray alloc] init]; fileTypes = [[self class] readableTypes]; + _docFlags.hasUndoManager = YES; /* Set our default type */ if ([fileTypes count]) @@ -817,7 +818,7 @@ - (NSUndoManager *)undoManager { - if (_undoManager == nil && [self hasUndoManager] == NO) + if (_undoManager == nil && [self hasUndoManager]) { [self setUndoManager: AUTORELEASE([[NSUndoManager alloc] init])]; }