From dbedf1803d0ebdbba827ba7d2d898535c8f32b1c Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 10 Feb 1999 04:17:06 +0000 Subject: [PATCH] Changed GetFrameState() and GetFrameType() to use pointer arguments instead of references git-svn-id: svn://10.0.0.236/trunk@20215 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/events/src/nsEventStateManager.cpp | 4 ++-- mozilla/layout/base/public/nsIFrame.h | 4 ++-- mozilla/layout/events/src/nsEventStateManager.cpp | 4 ++-- mozilla/layout/forms/nsListControlFrame.cpp | 2 +- mozilla/layout/generic/nsBlockReflowContext.cpp | 4 ++-- mozilla/layout/generic/nsContainerFrame.cpp | 4 ++-- mozilla/layout/generic/nsFrame.cpp | 10 ++++++---- mozilla/layout/generic/nsFrame.h | 4 ++-- mozilla/layout/generic/nsHTMLFrame.cpp | 2 +- mozilla/layout/generic/nsHTMLReflowState.cpp | 2 +- mozilla/layout/generic/nsIFrame.h | 4 ++-- mozilla/layout/html/base/src/nsBlockReflowContext.cpp | 4 ++-- mozilla/layout/html/base/src/nsContainerFrame.cpp | 4 ++-- mozilla/layout/html/base/src/nsFrame.cpp | 10 ++++++---- mozilla/layout/html/base/src/nsFrame.h | 4 ++-- mozilla/layout/html/base/src/nsHTMLFrame.cpp | 2 +- mozilla/layout/html/base/src/nsHTMLReflowState.cpp | 2 +- mozilla/layout/html/base/src/nsInlineReflow.cpp | 6 +++--- mozilla/layout/html/base/src/nsScrollFrame.cpp | 6 +++--- mozilla/layout/html/forms/src/nsListControlFrame.cpp | 2 +- 20 files changed, 44 insertions(+), 40 deletions(-) diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index e41a8174579..69b76a80b0c 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -75,7 +75,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext, mCurrentTarget = aTargetFrame; nsFrameState state; - mCurrentTarget->GetFrameState(state); + mCurrentTarget->GetFrameState(&state); state |= NS_FRAME_EXTERNAL_REFERENCE; mCurrentTarget->SetFrameState(state); @@ -109,7 +109,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext, nsresult ret = NS_OK; nsFrameState state; - mCurrentTarget->GetFrameState(state); + mCurrentTarget->GetFrameState(&state); state |= NS_FRAME_EXTERNAL_REFERENCE; mCurrentTarget->SetFrameState(state); diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h index 6c585a15734..e75256a6c93 100644 --- a/mozilla/layout/base/public/nsIFrame.h +++ b/mozilla/layout/base/public/nsIFrame.h @@ -395,7 +395,7 @@ public: * filled in with the state bits. The return value has no * meaning. */ - NS_IMETHOD GetFrameState(nsFrameState& aResult) = 0; + NS_IMETHOD GetFrameState(nsFrameState* aResult) = 0; /** * Set the current frame-state value for this frame. The return @@ -484,7 +484,7 @@ public: * * @see nsLayoutAtoms */ - NS_IMETHOD GetFrameType(nsIAtom*& aType) const = 0; + NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0; /** * Is this frame a "containing block"? diff --git a/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index e41a8174579..69b76a80b0c 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/layout/events/src/nsEventStateManager.cpp @@ -75,7 +75,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext, mCurrentTarget = aTargetFrame; nsFrameState state; - mCurrentTarget->GetFrameState(state); + mCurrentTarget->GetFrameState(&state); state |= NS_FRAME_EXTERNAL_REFERENCE; mCurrentTarget->SetFrameState(state); @@ -109,7 +109,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext, nsresult ret = NS_OK; nsFrameState state; - mCurrentTarget->GetFrameState(state); + mCurrentTarget->GetFrameState(&state); state |= NS_FRAME_EXTERNAL_REFERENCE; mCurrentTarget->SetFrameState(state); diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index b297273fd0c..f4f94a163b7 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -214,7 +214,7 @@ nsListControlFrame::GetFrameForPointUsing(const nsPoint& aPoint, mContentFrame->FirstChild(aList, &kid); while (nsnull != kid) { nsFrameState state; - kid->GetFrameState(state); + kid->GetFrameState(&state); if (NS_FRAME_OUTSIDE_CHILDREN & state) { kid->GetRect(kidRect); tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y); diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index d8ff2d7678f..22f48ad8292 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -108,7 +108,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // the frame state. nsReflowReason reason = eReflowReason_Resize; nsFrameState state; - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); if (NS_FRAME_FIRST_REFLOW & state) { reason = eReflowReason_Initial; } @@ -155,7 +155,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, aFrameReflowStatus); mOuterReflowState.spaceManager->Translate(-tx, -ty); - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) { // Provide combined area for child that doesn't have any mMetrics.mCombinedArea.x = 0; diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 0cb7e6cddb8..6b0d2612fd5 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -236,7 +236,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext, nsRect kidRect; aFrame->GetRect(kidRect); nsFrameState state; - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); // Compute the constrained damage area; set the overlap flag to // PR_TRUE if any portion of the child frame intersects the @@ -318,7 +318,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint, FirstChild(aList, &kid); while (nsnull != kid) { nsFrameState state; - kid->GetFrameState(state); + kid->GetFrameState(&state); if (NS_FRAME_OUTSIDE_CHILDREN & state) { kid->GetRect(kidRect); tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index fedeea9da09..c25cafbe7cb 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -1223,9 +1223,10 @@ nsFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame) // Resize and incremental reflow NS_IMETHODIMP -nsFrame::GetFrameState(nsFrameState& aResult) +nsFrame::GetFrameState(nsFrameState* aResult) { - aResult = mState; + NS_PRECONDITION(nsnull != aResult, "null OUT parameter pointer"); + *aResult = mState; return NS_OK; } @@ -1506,9 +1507,10 @@ NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const } NS_IMETHODIMP -nsFrame::GetFrameType(nsIAtom*& aType) const +nsFrame::GetFrameType(nsIAtom** aType) const { - aType = nsnull; + NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer"); + *aType = nsnull; return NS_OK; } diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 09ee066e86a..5f437b5f584 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -162,7 +162,7 @@ public: PRInt32& aCursor); NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame); - NS_IMETHOD GetFrameState(nsFrameState& aResult); + NS_IMETHOD GetFrameState(nsFrameState* aResult); NS_IMETHOD SetFrameState(nsFrameState aNewState); NS_IMETHOD ContentChanged(nsIPresContext* aPresContext, @@ -191,7 +191,7 @@ public: NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const; NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const; NS_IMETHOD GetWindow(nsIWidget*&) const; - NS_IMETHOD GetFrameType(nsIAtom*& aType) const; + NS_IMETHOD GetFrameType(nsIAtom** aType) const; NS_IMETHOD IsPercentageBase(PRBool& aBase) const; NS_IMETHOD GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const; NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const; diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 3ea9e6e7956..e3135fde0e5 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -288,7 +288,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext, // Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate nsFrameState kidState; - kidFrame->GetFrameState(kidState); + kidFrame->GetFrameState(&kidState); if (NS_FRAME_OUTSIDE_CHILDREN & kidState) { nscoord kidXMost = kidReflowState.computedMargin.left + kidDesiredSize.mCombinedArea.XMost(); diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 454ff6d6636..520459754cf 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -1190,7 +1190,7 @@ nsFrameReflowState::SetupChildReflowState(nsHTMLReflowState& aChildRS) nsReflowReason reason = eReflowReason_Resize; nsIFrame* frame = aChildRS.frame; nsFrameState state; - frame->GetFrameState(state); + frame->GetFrameState(&state); if (NS_FRAME_FIRST_REFLOW & state) { reason = eReflowReason_Initial; } diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index 6c585a15734..e75256a6c93 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -395,7 +395,7 @@ public: * filled in with the state bits. The return value has no * meaning. */ - NS_IMETHOD GetFrameState(nsFrameState& aResult) = 0; + NS_IMETHOD GetFrameState(nsFrameState* aResult) = 0; /** * Set the current frame-state value for this frame. The return @@ -484,7 +484,7 @@ public: * * @see nsLayoutAtoms */ - NS_IMETHOD GetFrameType(nsIAtom*& aType) const = 0; + NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0; /** * Is this frame a "containing block"? diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index d8ff2d7678f..22f48ad8292 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -108,7 +108,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // the frame state. nsReflowReason reason = eReflowReason_Resize; nsFrameState state; - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); if (NS_FRAME_FIRST_REFLOW & state) { reason = eReflowReason_Initial; } @@ -155,7 +155,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, aFrameReflowStatus); mOuterReflowState.spaceManager->Translate(-tx, -ty); - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) { // Provide combined area for child that doesn't have any mMetrics.mCombinedArea.x = 0; diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 0cb7e6cddb8..6b0d2612fd5 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -236,7 +236,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext, nsRect kidRect; aFrame->GetRect(kidRect); nsFrameState state; - aFrame->GetFrameState(state); + aFrame->GetFrameState(&state); // Compute the constrained damage area; set the overlap flag to // PR_TRUE if any portion of the child frame intersects the @@ -318,7 +318,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint, FirstChild(aList, &kid); while (nsnull != kid) { nsFrameState state; - kid->GetFrameState(state); + kid->GetFrameState(&state); if (NS_FRAME_OUTSIDE_CHILDREN & state) { kid->GetRect(kidRect); tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index fedeea9da09..c25cafbe7cb 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -1223,9 +1223,10 @@ nsFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame) // Resize and incremental reflow NS_IMETHODIMP -nsFrame::GetFrameState(nsFrameState& aResult) +nsFrame::GetFrameState(nsFrameState* aResult) { - aResult = mState; + NS_PRECONDITION(nsnull != aResult, "null OUT parameter pointer"); + *aResult = mState; return NS_OK; } @@ -1506,9 +1507,10 @@ NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const } NS_IMETHODIMP -nsFrame::GetFrameType(nsIAtom*& aType) const +nsFrame::GetFrameType(nsIAtom** aType) const { - aType = nsnull; + NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer"); + *aType = nsnull; return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 09ee066e86a..5f437b5f584 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -162,7 +162,7 @@ public: PRInt32& aCursor); NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame); - NS_IMETHOD GetFrameState(nsFrameState& aResult); + NS_IMETHOD GetFrameState(nsFrameState* aResult); NS_IMETHOD SetFrameState(nsFrameState aNewState); NS_IMETHOD ContentChanged(nsIPresContext* aPresContext, @@ -191,7 +191,7 @@ public: NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const; NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const; NS_IMETHOD GetWindow(nsIWidget*&) const; - NS_IMETHOD GetFrameType(nsIAtom*& aType) const; + NS_IMETHOD GetFrameType(nsIAtom** aType) const; NS_IMETHOD IsPercentageBase(PRBool& aBase) const; NS_IMETHOD GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const; NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const; diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index 3ea9e6e7956..e3135fde0e5 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -288,7 +288,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext, // Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate nsFrameState kidState; - kidFrame->GetFrameState(kidState); + kidFrame->GetFrameState(&kidState); if (NS_FRAME_OUTSIDE_CHILDREN & kidState) { nscoord kidXMost = kidReflowState.computedMargin.left + kidDesiredSize.mCombinedArea.XMost(); diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index 454ff6d6636..520459754cf 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -1190,7 +1190,7 @@ nsFrameReflowState::SetupChildReflowState(nsHTMLReflowState& aChildRS) nsReflowReason reason = eReflowReason_Resize; nsIFrame* frame = aChildRS.frame; nsFrameState state; - frame->GetFrameState(state); + frame->GetFrameState(&state); if (NS_FRAME_FIRST_REFLOW & state) { reason = eReflowReason_Initial; } diff --git a/mozilla/layout/html/base/src/nsInlineReflow.cpp b/mozilla/layout/html/base/src/nsInlineReflow.cpp index 8b83b31e8f8..2db72ce29dd 100644 --- a/mozilla/layout/html/base/src/nsInlineReflow.cpp +++ b/mozilla/layout/html/base/src/nsInlineReflow.cpp @@ -396,7 +396,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop, nsReflowReason reason = eReflowReason_Resize; nsIFrame* frame = pfd->mFrame; nsFrameState state; - frame->GetFrameState(state); + frame->GetFrameState(&state); if (NS_FRAME_FIRST_REFLOW & state) { reason = eReflowReason_Initial; } @@ -444,7 +444,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop, htmlReflow->Reflow(mPresContext, aMetrics, reflowState, aStatus); // XXX could return this in aStatus to save a few cycles // XXX could mandate that child sets up mCombinedArea too... - frame->GetFrameState(state); + frame->GetFrameState(&state); if (NS_FRAME_OUTSIDE_CHILDREN & state) { pfd->mCombinedArea = aMetrics.mCombinedArea; } @@ -463,7 +463,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop, // the NS_FRAME_FIRST_REFLOW bit is cleared so that never give it an // initial reflow reason again. if (eReflowReason_Initial == reason) { - frame->GetFrameState(state); + frame->GetFrameState(&state); frame->SetFrameState(state & ~NS_FRAME_FIRST_REFLOW); } diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index 78d5e5f9fb8..8ef0e89faba 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -76,7 +76,7 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext, // We need to allow the view's position to be different than the // frame's position nsFrameState state; - frame->GetFrameState(state); + frame->GetFrameState(&state); state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW; frame->SetFrameState(state); @@ -342,7 +342,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // If the frame has child frames that stick outside its bounds, then take // them into account, too nsFrameState kidState; - kidFrame->GetFrameState(kidState); + kidFrame->GetFrameState(&kidState); if (NS_FRAME_OUTSIDE_CHILDREN & kidState) { kidDesiredSize.width = kidDesiredSize.mCombinedArea.width; kidDesiredSize.height = kidDesiredSize.mCombinedArea.height; @@ -401,7 +401,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // If the frame has child frames that stick outside its bounds, then take // them into account, too nsFrameState kidState; - kidFrame->GetFrameState(kidState); + kidFrame->GetFrameState(&kidState); if (NS_FRAME_OUTSIDE_CHILDREN & kidState) { kidDesiredSize.width = kidDesiredSize.mCombinedArea.width; kidDesiredSize.height = kidDesiredSize.mCombinedArea.height; diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index b297273fd0c..f4f94a163b7 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -214,7 +214,7 @@ nsListControlFrame::GetFrameForPointUsing(const nsPoint& aPoint, mContentFrame->FirstChild(aList, &kid); while (nsnull != kid) { nsFrameState state; - kid->GetFrameState(state); + kid->GetFrameState(&state); if (NS_FRAME_OUTSIDE_CHILDREN & state) { kid->GetRect(kidRect); tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);