From d852583364bcd32e324577c2d2f8ee3e4e0adfbf Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Tue, 16 May 2000 12:18:36 +0000 Subject: [PATCH] fixes for RegUnRegAccessKey git-svn-id: svn://10.0.0.236/trunk@70033 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsComboboxControlFrame.cpp | 14 +++++++++++++- .../html/forms/src/nsComboboxControlFrame.cpp | 14 +++++++++++++- .../html/forms/src/nsGfxTextControlFrame2.cpp | 13 +++++++++---- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index f245fd583de..a5c2c357193 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -262,12 +262,24 @@ nsComboboxControlFrame::~nsComboboxControlFrame() mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } - NS_IF_RELEASE(mPresContext); NS_IF_RELEASE(mButtonContent); nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + NS_IF_RELEASE(mPresContext); } +NS_IMETHODIMP +nsComboboxControlFrame::Destroy(nsIPresContext* aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + if (mFormFrame) { + mFormFrame->RemoveFormControlFrame(*this); + mFormFrame = nsnull; + } + return nsHTMLContainerFrame::Destroy(aPresContext); +} + + //-------------------------------------------------------------- // Frames are not refcounted, no need to AddRef NS_IMETHODIMP diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index f245fd583de..a5c2c357193 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -262,12 +262,24 @@ nsComboboxControlFrame::~nsComboboxControlFrame() mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } - NS_IF_RELEASE(mPresContext); NS_IF_RELEASE(mButtonContent); nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + NS_IF_RELEASE(mPresContext); } +NS_IMETHODIMP +nsComboboxControlFrame::Destroy(nsIPresContext* aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + if (mFormFrame) { + mFormFrame->RemoveFormControlFrame(*this); + mFormFrame = nsnull; + } + return nsHTMLContainerFrame::Destroy(aPresContext); +} + + //-------------------------------------------------------------- // Frames are not refcounted, no need to AddRef NS_IMETHODIMP diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index f082147be42..52a4513930f 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -508,15 +508,20 @@ nsGfxTextControlFrame2::nsGfxTextControlFrame2() nsGfxTextControlFrame2::~nsGfxTextControlFrame2() { - nsFormControlFrame::RegUnRegAccessKey(nsnull, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + +} + +NS_IMETHODIMP +nsGfxTextControlFrame2::Destroy(nsIPresContext* aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } - + return nsHTMLContainerFrame::Destroy(aPresContext); } - // XXX: wouldn't it be nice to get this from the style context! PRBool nsGfxTextControlFrame2::IsSingleLineTextControl() const { @@ -1158,7 +1163,7 @@ NS_IMETHODIMP nsGfxTextControlFrame2::Reflow(nsIPresContext* aPresConte } else if (eReflowReason_Initial == aReflowState.reason) { - nsFormControlFrame::RegUnRegAccessKey(nsnull, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); nsCOMPtr htmlContent; nsString value;