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:
kin%netscape.com 2000-07-28 13:53:26 +00:00
Родитель e18d36af10
Коммит f7bae8dd4c
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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);