зеркало из https://github.com/mozilla/pjs.git
Fix for bug #46657: an Undo past default text value in a TextWidget
Modified CreateAnonymousContent() to disable editor undo before setting the default value, and then reenable it afterwards. r=brade@netscape.com
This commit is contained in:
Родитель
e18d36af10
Коммит
f7bae8dd4c
|
@ -1714,9 +1714,22 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext,
|
|||
|
||||
// Now call SetTextControlFrameState() which will make the
|
||||
// neccessary editor calls to set the default value.
|
||||
// Make sure to turn off undo before setting the default
|
||||
// value, and turn it back on afterwards. This will make
|
||||
// sure we can't undo past the default value.
|
||||
|
||||
rv = mEditor->EnableUndo(PR_FALSE);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
SetTextControlFrameState(defaultValue);
|
||||
|
||||
rv = mEditor->EnableUndo(PR_TRUE);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// Now restore the original editor flags.
|
||||
|
||||
rv = mEditor->SetFlags(editorFlags);
|
||||
|
|
Загрузка…
Ссылка в новой задаче