workaround needed as a result of hyatt's change to frame construction code and attribute notification.

This commit is contained in:
buster%netscape.com 1999-09-09 19:45:32 +00:00
parent 541c8bfb5d
commit 408c05bfea
2 changed files with 14 additions and 7 deletions

View File

@ -193,6 +193,7 @@ nsGfxTextControlFrame::nsGfxTextControlFrame()
: mWebShell(0), mCreatingViewer(PR_FALSE),
mTempObserver(0), mDocObserver(0),
mDummyFrame(0), mNeedsStyleInit(PR_TRUE),
mIsProcessing(PR_FALSE),
mDummyInitialized(PR_FALSE) // DUMMY
{
}
@ -695,14 +696,19 @@ void nsGfxTextControlFrame::SetTextControlFrameState(const nsString& aValue)
NS_IMETHODIMP nsGfxTextControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue)
{
if (nsHTMLAtoms::value == aName)
if (PR_FALSE==mIsProcessing)
{
mEditor->EnableUndo(PR_FALSE); // wipe out undo info
SetTextControlFrameState(aValue); // set new text value
mEditor->EnableUndo(PR_TRUE); // fire up a new txn stack
}
else {
return Inherited::SetProperty(aName, aValue);
mIsProcessing = PR_TRUE;
if (nsHTMLAtoms::value == aName)
{
mEditor->EnableUndo(PR_FALSE); // wipe out undo info
SetTextControlFrameState(aValue); // set new text value
mEditor->EnableUndo(PR_TRUE); // fire up a new txn stack
}
else {
return Inherited::SetProperty(aName, aValue);
}
mIsProcessing = PR_FALSE;
}
return NS_OK;
}

View File

@ -504,6 +504,7 @@ protected:
nsCOMPtr<nsIEditor> mEditor; // ref counted
nsCOMPtr<nsIDOMDocument> mDoc; // ref counted
PRBool mIsProcessing;
nsNativeTextControlFrame *mDummyFrame; //DUMMY
PRBool mNeedsStyleInit;