Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Feb 2005 06:18:44 +0000 (06:18 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Feb 2005 06:18:44 +0000 (06:18 +0000)
        - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu

        * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
        removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
        will be the text storage object, but given the NSText architecture, that's pretty clear.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8530 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQTextArea.mm

index 33947761501820a550279f818eb54a93ed8ee19b..897873a8fcfb6a4692c1ff9d45d4b03678942194 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-06  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
+
+        * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
+        removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
+        will be the text storage object, but given the NSText architecture, that's pretty clear.
+
 2005-02-05  Chris Blumenberg  <cblu@apple.com>
 
        Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
index 1f1b63b8de1097c059f3a5513cb6ddac4133c697..d2ae8ffb82bb0c8f9fd62b71fdfd9bf7db50db45 100644 (file)
@@ -531,6 +531,14 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
         borderType:[self borderType]];
 }
 
+- (void)viewWillMoveToWindow:(NSWindow *)window
+{
+    if ([self window] != window) {
+        [[textView undoManager] removeAllActionsWithTarget:[textView textStorage]];
+    }
+    [super viewWillMoveToWindow:window];
+}
+
 @end
 
 @implementation KWQTextAreaTextView