fixing regunreg for form controls

This commit is contained in:
mjudge@netscape.com
2000-05-16 12:44:32 +00:00
parent 959608e17b
commit 6321cfa42d
7 changed files with 45 additions and 21 deletions

View File

@@ -83,7 +83,6 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame()
mTranslatedRect = nsRect(0,0,0,0);
mDidInit = PR_FALSE;
mRenderer.SetNameSpace(kNameSpaceID_None);
mPresContext = nsnull;
mCacheSize.width = -1;
mCacheSize.height = -1;
@@ -93,11 +92,17 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame()
nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame()
{
nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::Destroy(nsIPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mFormFrame) {
mFormFrame->RemoveFormControlFrame(*this);
mFormFrame = nsnull;
}
return nsHTMLContainerFrame::Destroy(aPresContext);
}
NS_IMETHODIMP
@@ -525,7 +530,6 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame", aReflowState.reason);
if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) {
mPresContext = aPresContext;
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this));
}