Adium

Changeset 22967

Show
Ignore:
Timestamp:
03/21/2008 10:34:21 PM (8 months ago)
Author:
evands
Message:

Merged [22966]: Each message view controller now provides a unique undo manager to its message entry text view. If we don't do this, we end up with a single undo manager for the whole window per the documentation on the undo manager hierarchy.

This fixes a number of obscure undo/redo bugs in the message window, including crashes after closing a tab and invoking undo/redo (fixes #9511) and undo/redo working across multiple tabs (only one of which is visible) which was just weird.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/adium-1.2/Plugins/Dual Window Interface/AIMessageViewController.h

    r22721 r22967  
    6666        int                                             entryMinHeight; 
    6767        int                                             userListMinWidth; 
     68 
     69        NSUndoManager           *undoManager; 
    6870} 
    6971 
  • branches/adium-1.2/Plugins/Dual Window Interface/AIMessageViewController.m

    r22721 r22967  
    222222        //release menuItem 
    223223        [showHide release]; 
     224         
     225        [undoManager release]; undoManager = nil; 
     226 
    224227    [super dealloc]; 
    225228} 
     
    11251128}        
    11261129 
     1130#pragma mark Undo 
     1131- (NSUndoManager *)undoManagerForTextView:(NSTextView *)aTextView 
     1132{ 
     1133        if (!undoManager) 
     1134                undoManager = [[NSUndoManager alloc] init]; 
     1135 
     1136        return undoManager; 
     1137} 
     1138 
     1139 
    11271140@end