fixing regunreg for form controls

git-svn-id: svn://10.0.0.236/trunk@70037 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
2000-05-16 12:44:32 +00:00
parent 6c7384a436
commit 2126ead29a
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));
}

View File

@@ -63,6 +63,7 @@ public:
~nsHTMLButtonControlFrame();
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@@ -156,8 +157,6 @@ protected:
PRBool mDidInit;
nsButtonFrameRenderer mRenderer;
nsIPresContext * mPresContext;
//Resize Reflow OpitmizationSize;
nsSize mCacheSize;
nsSize mCachedMaxElementSize;

View File

@@ -69,7 +69,8 @@ public:
nsImageControlFrame();
~nsImageControlFrame();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
@@ -147,7 +148,6 @@ protected:
nsRect mTranslatedRect;
PRBool mGotFocus;
nsCOMPtr<nsIPresContext> mPresContext;
};
@@ -163,12 +163,18 @@ nsImageControlFrame::nsImageControlFrame()
nsImageControlFrame::~nsImageControlFrame()
{
nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}
NS_IMETHODIMP
nsImageControlFrame::Destroy(nsIPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mFormFrame) {
mFormFrame->RemoveFormControlFrame(*this);
mFormFrame = nsnull;
}
return nsImageControlFrameSuper::Destroy(aPresContext);
}
nsresult
@@ -261,7 +267,6 @@ nsImageControlFrame::Reflow(nsIPresContext* aPresContext,
{
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason);
if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) {
mPresContext = aPresContext;
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
// add ourself as an nsIFormControlFrame
nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this));

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

View File

@@ -63,6 +63,7 @@ public:
~nsHTMLButtonControlFrame();
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@@ -156,8 +157,6 @@ protected:
PRBool mDidInit;
nsButtonFrameRenderer mRenderer;
nsIPresContext * mPresContext;
//Resize Reflow OpitmizationSize;
nsSize mCacheSize;
nsSize mCachedMaxElementSize;

View File

@@ -69,7 +69,8 @@ public:
nsImageControlFrame();
~nsImageControlFrame();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
@@ -147,7 +148,6 @@ protected:
nsRect mTranslatedRect;
PRBool mGotFocus;
nsCOMPtr<nsIPresContext> mPresContext;
};
@@ -163,12 +163,18 @@ nsImageControlFrame::nsImageControlFrame()
nsImageControlFrame::~nsImageControlFrame()
{
nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}
NS_IMETHODIMP
nsImageControlFrame::Destroy(nsIPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mFormFrame) {
mFormFrame->RemoveFormControlFrame(*this);
mFormFrame = nsnull;
}
return nsImageControlFrameSuper::Destroy(aPresContext);
}
nsresult
@@ -261,7 +267,6 @@ nsImageControlFrame::Reflow(nsIPresContext* aPresContext,
{
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason);
if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) {
mPresContext = aPresContext;
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
// add ourself as an nsIFormControlFrame
nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this));

View File

@@ -70,6 +70,8 @@ public:
nsLabelFrame();
virtual ~nsLabelFrame();
NS_IMETHOD Destroy(nsIPresContext *aPresContext);
NS_IMETHOD Init(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
@@ -119,7 +121,6 @@ protected:
nsIFormControlFrame* mControlFrame;
nsRect mTranslatedRect;
nsCOMPtr<nsIPresContext> mPresContext;
};
nsresult
@@ -156,9 +157,17 @@ nsLabelFrame::nsLabelFrame()
nsLabelFrame::~nsLabelFrame()
{
nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}
NS_IMETHODIMP
nsLabelFrame::Destroy(nsIPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsHTMLContainerFrame::Destroy(aPresContext);
}
void
nsLabelFrame::GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect)
{
@@ -569,7 +578,6 @@ nsLabelFrame::Reflow(nsIPresContext* aPresContext,
NS_ASSERTION(nextFrame == mFrames.FirstChild(), "unexpected next reflow command frame");
}
} else if (eReflowReason_Initial == aReflowState.reason) {
mPresContext = aPresContext;
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}