discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUndoManager patch


From: Wolfgang Lux
Subject: NSUndoManager patch
Date: Mon, 24 Sep 2007 15:35:58 +0200

Hello!

Here is a patch for NSUndoManager. The patch prevents NSUndoManager from
(incorrectly!) posting NSUndoManagerDidOpenUndoGroupNotification and
NSUndoManagerWillCloseUndoGroupNotification notifications when performing
an undo or redo. Furthermore, with this patch the private -_loop: method
no longer opens a new undo group automatically. This is
a) unnecessary because the methods -forwardInvocation: and
-registerUndoWithTarget:selector:object: already take care of this, and
b) can needlessly create empty undo groups on the undo stack.
Creating such empty groups will confuse the change count management in
NSDocument. For the same reason, the patch changes the code in
-setRunLoopModes: such that it will not schedule a call to -_loop:
unconditionally.

As a consequence of these changes, the change count of an NSDocument now
becomes zero again after undoing all changes in the document.

Wolfgang

Attachment: NSUndoManager.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]