Fix for bug #75305: Doing Undo and Redo crashes browser

Added nsAutoUpdateViewBatch class, and use it in
nsPlaintexteditor::Undo()/Redo().

    editor/base/nsEditorUtils.h
    editor/base/nsPlaintextEditor.cpp

r=jfrancis@netscape.com   sr=sfraser@netscape.com


git-svn-id: svn://10.0.0.236/trunk@94654 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kin%netscape.com
2001-05-11 13:59:11 +00:00
parent 3fd1e3f83f
commit 8dade4ed7b
4 changed files with 56 additions and 0 deletions

View File

@@ -1301,6 +1301,8 @@ nsPlaintextEditor::SetWrapWidth(PRInt32 aWrapColumn)
NS_IMETHODIMP
nsPlaintextEditor::Undo(PRUint32 aCount)
{
nsAutoUpdateViewBatch beginViewBatching(this);
ForceCompositionEnd();
nsresult result = NS_OK;
@@ -1327,6 +1329,7 @@ nsPlaintextEditor::Redo(PRUint32 aCount)
{
nsresult result = NS_OK;
nsAutoUpdateViewBatch beginViewBatching(this);
nsAutoRules beginRulesSniffing(this, kOpRedo, nsIEditor::eNone);
nsTextRulesInfo ruleInfo(nsTextEditRules::kRedo);