From 7c6f6cb50cc5d1a4abbab6e0ee4511db69293c73 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Wed, 1 Jul 2009 12:12:04 -0700 Subject: [PATCH] Bug 434766 - Don't try to use the selection if we don't need one. r+sr=peterv --- editor/libeditor/html/nsHTMLEditRules.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/libeditor/html/nsHTMLEditRules.cpp b/editor/libeditor/html/nsHTMLEditRules.cpp index 2def87e1152..a9313d481ba 100644 --- a/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/editor/libeditor/html/nsHTMLEditRules.cpp @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sw=2 et tw=79: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -600,7 +601,10 @@ nsHTMLEditRules::WillDoAction(nsISelection *aSelection, // Deal with actions for which we don't need to check whether the selection is // editable. - if (info->action == kOutputText) { + if (info->action == kOutputText || + info->action == kUndo || + info->action == kRedo) + { return nsTextEditRules::WillDoAction(aSelection, aInfo, aCancel, aHandled); } @@ -642,7 +646,7 @@ nsHTMLEditRules::WillDoAction(nsISelection *aSelection, return NS_OK; } } - + switch (info->action) { case kInsertText: