From 8ff3bd2db3df673b204a5de182a0935ddc2d96ca Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 20 Oct 2005 02:10:31 +0000 Subject: [PATCH] Fix bug 309467. r=jst, sr=neil git-svn-id: svn://10.0.0.236/trunk@182569 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsTextControlFrame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index 2ab0b3091c5..4680d98f3f4 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -142,6 +142,7 @@ static NS_DEFINE_CID(kFrameSelectionCID, NS_FRAMESELECTION_CID); static const PRInt32 DEFAULT_COLS = 20; static const PRInt32 DEFAULT_ROWS = 1; static const PRInt32 DEFAULT_ROWS_TEXTAREA = 2; +static const PRInt32 DEFAULT_UNDO_CAP = 1000; static nsINativeKeyBindings *sNativeInputBindings = nsnull; static nsINativeKeyBindings *sNativeTextAreaBindings = nsnull; @@ -1748,6 +1749,12 @@ nsTextControlFrame::InitEditor() return rv; } + nsCOMPtr transMgr; + mEditor->GetTransactionManager(getter_AddRefs(transMgr)); + NS_ENSURE_TRUE(transMgr, NS_ERROR_FAILURE); + + transMgr->SetMaxTransactionCount(DEFAULT_UNDO_CAP); + if (IsPasswordTextControl()) { // Disable undo for password textfields. Note that we want to do this at // the very end of InitEditor, so the calls to EnableUndo when setting the