diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index e01464cdc2d..0957416ddf7 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -821,9 +821,7 @@ AdjustAbsoluteContainingBlock(nsIPresContext* aPresContext, nsIFrame* aContainingBlockIn) { nsIFrame* containingBlock = aContainingBlockIn; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (!paginated) { + if (!aPresContext->IsPaginated()) { if (nsLayoutAtoms::positionedInlineFrame == containingBlock->GetType()) { containingBlock = ((nsPositionedInlineFrame*)containingBlock)->GetFirstInFlow(); } @@ -3059,10 +3057,8 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresShell* aPresShell, case NS_STYLE_DISPLAY_TABLE: { PRBool pageBreakAfter = PR_FALSE; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (paginated) { + if (aPresContext->IsPaginated()) { // See if there is a page break before, if so construct one. Also see if there is one after pageBreakAfter = PageBreakBefore(aPresShell, aPresContext, aState, aChildContent, aParentFrame, childStyleContext, aChildItems); @@ -3309,14 +3305,12 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, // --------- IF SCROLLABLE WRAP IN SCROLLFRAME -------- PRBool isScrollable = IsScrollable(aPresContext, display); - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); nsCOMPtr printPreviewContext(do_QueryInterface(aPresContext)); nsIFrame* scrollFrame = nsnull; // build a scrollframe - if ((!isPaginated || (isPaginated && printPreviewContext)) && isScrollable) { + if ((!aPresContext->IsPaginated() || printPreviewContext) && isScrollable) { nsIFrame* newScrollFrame = nsnull; nsRefPtr newContext; @@ -3566,8 +3560,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // - renders the document element's background. This ensures the background covers // the entire canvas as specified by the CSS2 spec - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsCOMPtr printPreviewContext(do_QueryInterface(aPresContext)); nsIFrame* rootFrame = nsnull; @@ -3649,7 +3642,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, if (isPaginated) { if (printPreviewContext) { // print preview - aPresContext->GetPaginatedScrolling(&isScrollable); + isScrollable = aPresContext->HasPaginatedScrolling(); } else { isScrollable = PR_FALSE; // we are printing } @@ -3808,7 +3801,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, rootFrame->Init(aPresContext, aDocElement, parentFrame, rootPseudoStyle, nsnull); - if (!isPaginated || (isPaginated && printPreviewContext)) { + if (!isPaginated || printPreviewContext) { if (isScrollable) { FinishBuildingScrollFrame(aPresContext, state, @@ -6943,10 +6936,8 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresShell* aPresShell, aContent->GetNameSpaceID(&nameSpaceID); PRBool pageBreakAfter = PR_FALSE; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (paginated) { + if (aPresContext->IsPaginated()) { // See if there is a page break before, if so construct one. Also see if there is one after pageBreakAfter = PageBreakBefore(aPresShell, aPresContext, aState, aContent, aParentFrame, styleContext, aFrameItems); diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index fe47d06d475..f7d3430e164 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -3005,9 +3005,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, aPresContext->PresShell()->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame, "no root frame"); - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { nsIFrame* page = nsLayoutUtils::GetPageFrame(aForFrame); NS_ASSERTION(page, "no page"); rootFrame = page; diff --git a/mozilla/layout/base/nsPresContext.h b/mozilla/layout/base/nsPresContext.h index d940a95cfc7..9a66cb568cc 100644 --- a/mozilla/layout/base/nsPresContext.h +++ b/mozilla/layout/base/nsPresContext.h @@ -296,19 +296,19 @@ public: * Return true if this presentation context is a paginated * context. */ - NS_IMETHOD IsPaginated(PRBool* aResult) = 0; + PRBool IsPaginated() const { return mPaginated; } /** * Sets whether the presentation context can scroll for a paginated * context. */ - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) = 0; + virtual void SetPaginatedScrolling(PRBool aResult) = 0; /** * Return true if this presentation context can scroll for paginated * context. */ - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult) = 0; + PRBool HasPaginatedScrolling() const { return mCanPaginatedScroll; } /** * Gets the rect for the page dimensions, @@ -555,6 +555,8 @@ protected: unsigned mNeverAnimate : 1; unsigned mIsRenderingOnlySelection : 1; unsigned mNoTheme : 1; + unsigned mPaginated : 1; + unsigned mCanPaginatedScroll : 1; #ifdef IBMBIDI unsigned mIsVisual : 1; unsigned mIsBidiSystem : 1; diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index cfefbd9b1ee..c49d6ef6ff2 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -2862,9 +2862,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) } // For printing, we just immediately unsuppress. - PRBool isPaginated = PR_FALSE; - mPresContext->IsPaginated(&isPaginated); - if (!isPaginated) { + if (!mPresContext->IsPaginated()) { // Kick off a one-shot timer based off our pref value. When this timer // fires, if painting is still locked down, then we will go ahead and // trigger a full invalidate and allow painting to proceed normally. @@ -6944,9 +6942,7 @@ PresShell::VerifyIncrementalReflow() // Create a presentation context to view the new frame tree nsresult rv; - PRBool isPaginated = PR_FALSE; - mPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (mPresContext->IsPaginated()) { nsCOMPtr ppx = do_CreateInstance(kPrintPreviewContextCID, &rv); if (NS_SUCCEEDED(rv)) { ppx->QueryInterface(NS_GET_IID(nsIPresContext),(void**)&cx); diff --git a/mozilla/layout/base/public/nsIPresContext.h b/mozilla/layout/base/public/nsIPresContext.h index d940a95cfc7..9a66cb568cc 100644 --- a/mozilla/layout/base/public/nsIPresContext.h +++ b/mozilla/layout/base/public/nsIPresContext.h @@ -296,19 +296,19 @@ public: * Return true if this presentation context is a paginated * context. */ - NS_IMETHOD IsPaginated(PRBool* aResult) = 0; + PRBool IsPaginated() const { return mPaginated; } /** * Sets whether the presentation context can scroll for a paginated * context. */ - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) = 0; + virtual void SetPaginatedScrolling(PRBool aResult) = 0; /** * Return true if this presentation context can scroll for paginated * context. */ - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult) = 0; + PRBool HasPaginatedScrolling() const { return mCanPaginatedScroll; } /** * Gets the rect for the page dimensions, @@ -555,6 +555,8 @@ protected: unsigned mNeverAnimate : 1; unsigned mIsRenderingOnlySelection : 1; unsigned mNoTheme : 1; + unsigned mPaginated : 1; + unsigned mCanPaginatedScroll : 1; #ifdef IBMBIDI unsigned mIsVisual : 1; unsigned mIsBidiSystem : 1; diff --git a/mozilla/layout/base/public/nsPresContext.h b/mozilla/layout/base/public/nsPresContext.h index d940a95cfc7..9a66cb568cc 100644 --- a/mozilla/layout/base/public/nsPresContext.h +++ b/mozilla/layout/base/public/nsPresContext.h @@ -296,19 +296,19 @@ public: * Return true if this presentation context is a paginated * context. */ - NS_IMETHOD IsPaginated(PRBool* aResult) = 0; + PRBool IsPaginated() const { return mPaginated; } /** * Sets whether the presentation context can scroll for a paginated * context. */ - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) = 0; + virtual void SetPaginatedScrolling(PRBool aResult) = 0; /** * Return true if this presentation context can scroll for paginated * context. */ - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult) = 0; + PRBool HasPaginatedScrolling() const { return mCanPaginatedScroll; } /** * Gets the rect for the page dimensions, @@ -555,6 +555,8 @@ protected: unsigned mNeverAnimate : 1; unsigned mIsRenderingOnlySelection : 1; unsigned mNoTheme : 1; + unsigned mPaginated : 1; + unsigned mCanPaginatedScroll : 1; #ifdef IBMBIDI unsigned mIsVisual : 1; unsigned mIsBidiSystem : 1; diff --git a/mozilla/layout/base/src/nsGalleyContext.cpp b/mozilla/layout/base/src/nsGalleyContext.cpp index 865f4e67ee4..a1cc3acf3b9 100644 --- a/mozilla/layout/base/src/nsGalleyContext.cpp +++ b/mozilla/layout/base/src/nsGalleyContext.cpp @@ -44,9 +44,7 @@ public: GalleyContext(); ~GalleyContext(); - NS_IMETHOD IsPaginated(PRBool* aResult); - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) { return NS_ERROR_FAILURE; } - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult); + virtual void SetPaginatedScrolling(PRBool aResult) {} virtual void GetPageDim(nsRect* aActualRect, nsRect* aAdjRect); virtual void SetPageDim(nsRect* aRect); }; @@ -60,25 +58,6 @@ GalleyContext::~GalleyContext() { } -NS_IMETHODIMP -GalleyContext::IsPaginated(PRBool* aResult) -{ - NS_PRECONDITION(nsnull != aResult, "null ptr"); - if (nsnull == aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = PR_FALSE; - return NS_OK; -} - -NS_IMETHODIMP -GalleyContext::GetPaginatedScrolling(PRBool* aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = PR_FALSE; - return NS_OK; -} - void GalleyContext::GetPageDim(nsRect* aActualRect, nsRect* aAdjRect) { diff --git a/mozilla/layout/base/src/nsPresContext.h b/mozilla/layout/base/src/nsPresContext.h index d6e405e121c..c637746a58d 100644 --- a/mozilla/layout/base/src/nsPresContext.h +++ b/mozilla/layout/base/src/nsPresContext.h @@ -86,9 +86,6 @@ public: virtual void StopImagesFor(nsIFrame* aTargetFrame); virtual void SetContainer(nsISupports* aContainer); virtual already_AddRefed GetContainer(); - NS_IMETHOD IsPaginated(PRBool* aResult) = 0; - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) = 0; - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult) = 0; virtual void GetPageDim(nsRect* aActualRect, nsRect* aAdjRect) = 0; virtual void SetPageDim(nsRect* aRect) = 0; NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const; diff --git a/mozilla/layout/base/src/nsPrintContext.cpp b/mozilla/layout/base/src/nsPrintContext.cpp index 9ba51e16e21..caa23b1415e 100644 --- a/mozilla/layout/base/src/nsPrintContext.cpp +++ b/mozilla/layout/base/src/nsPrintContext.cpp @@ -59,9 +59,7 @@ public: PrintContext(); ~PrintContext(); - NS_IMETHOD IsPaginated(PRBool* aResult); - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) { return NS_ERROR_FAILURE; } - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult); + virtual void SetPaginatedScrolling(PRBool aResult) {} virtual void GetPageDim(nsRect* aActualRect, nsRect* aAdjRect); virtual void SetPageDim(nsRect* aRect); virtual void SetImageAnimationMode(PRUint16 aMode); @@ -82,6 +80,7 @@ PrintContext::PrintContext() : mImageAnimationMode = imgIContainer::kDontAnimMode; mNeverAnimate = PR_TRUE; mMedium = nsLayoutAtoms::print; + mPaginated = PR_TRUE; } PrintContext::~PrintContext() @@ -107,22 +106,6 @@ PrintContext::QueryInterface(REFNSIID aIID, void** aInstancePtr) return nsPresContext::QueryInterface(aIID, aInstancePtr); } -NS_IMETHODIMP -PrintContext::IsPaginated(PRBool* aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = PR_TRUE; - return NS_OK; -} - -NS_IMETHODIMP -PrintContext::GetPaginatedScrolling(PRBool* aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = PR_FALSE; - return NS_OK; -} - void PrintContext::GetPageDim(nsRect* aActualRect, nsRect* aAdjRect) { diff --git a/mozilla/layout/base/src/nsPrintPreviewContext.cpp b/mozilla/layout/base/src/nsPrintPreviewContext.cpp index 01299c567dc..7c46805f6d8 100644 --- a/mozilla/layout/base/src/nsPrintPreviewContext.cpp +++ b/mozilla/layout/base/src/nsPrintPreviewContext.cpp @@ -56,9 +56,11 @@ public: // another class. Only the base class should use NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS_INHERITED - NS_IMETHOD IsPaginated(PRBool* aResult); - NS_IMETHOD SetPaginatedScrolling(PRBool aResult) { mCanPaginatedScroll = aResult; return NS_OK; } - NS_IMETHOD GetPaginatedScrolling(PRBool* aResult); + virtual void SetPaginatedScrolling(PRBool aResult) + { + mCanPaginatedScroll = aResult; + } + virtual void GetPageDim(nsRect* aActualRect, nsRect* aAdjRect); virtual void SetPageDim(nsRect* aRect); virtual void SetImageAnimationMode(PRUint16 aMode); @@ -69,14 +71,12 @@ public: protected: nsRect mPageDim; - PRBool mCanPaginatedScroll; nsCOMPtr mPrintSettings; PRPackedBool mDoScaledTwips; }; PrintPreviewContext::PrintPreviewContext() : mPageDim(-1,-1,-1,-1), - mCanPaginatedScroll(PR_TRUE), mDoScaledTwips(PR_TRUE) { SetBackgroundImageDraw(PR_FALSE); @@ -85,6 +85,8 @@ PrintPreviewContext::PrintPreviewContext() : mImageAnimationMode = imgIContainer::kDontAnimMode; mNeverAnimate = PR_TRUE; mMedium = nsLayoutAtoms::print; + mPaginated = PR_TRUE; + mCanPaginatedScroll = PR_TRUE; } PrintPreviewContext::~PrintPreviewContext() @@ -108,22 +110,6 @@ PrintPreviewContext::QueryInterface(REFNSIID aIID, void** aInstancePtr) return nsPresContext::QueryInterface(aIID, aInstancePtr); } -NS_IMETHODIMP -PrintPreviewContext::IsPaginated(PRBool* aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = PR_TRUE; - return NS_OK; -} - -NS_IMETHODIMP -PrintPreviewContext::GetPaginatedScrolling(PRBool* aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = mCanPaginatedScroll; - return NS_OK; -} - void PrintPreviewContext::GetPageDim(nsRect* aActualRect, nsRect* aAdjRect) { diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index e21e65af6f5..ddf75190771 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -1943,9 +1943,7 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp index 9d268452cf1..c61ff00385c 100644 --- a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp @@ -387,9 +387,7 @@ nsGfxButtonControlFrame::HandleEvent(nsIPresContext* aPresContext, nsEventStatus* aEventStatus) { // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } // Override the HandleEvent to prevent the nsFrame::HandleEvent diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 1bc02a88c50..ac31b9663a5 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -527,9 +527,7 @@ nsListControlFrame::Paint(nsIPresContext* aPresContext, // Start by assuming we are visible and need to be painted PRBool isVisible = PR_TRUE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT; @@ -1713,9 +1711,7 @@ nsListControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index f3663bedfa3..f15d89ed6b9 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -1208,7 +1208,7 @@ SuppressEventHandlers(nsIPresContext* aPresContext) // In the current implementation, we only paginate when // printing or in print preview. - aPresContext->IsPaginated(&suppressHandlers); + suppressHandlers = aPresContext->IsPaginated(); #endif } @@ -3126,9 +3126,7 @@ nsTextControlFrame::HandleEvent(nsIPresContext* aPresContext, NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 3eefd27d9b0..bb12228de09 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -2776,12 +2776,11 @@ nsresult nsFrame::GetSelectionForVisCheck(nsIPresContext * aPresContext, nsISelection** aSelection) { *aSelection = nsnull; + nsresult rv = NS_OK; // start by checking to see if we are paginated which probably means // we are in print preview or printing - PRBool isPaginated; - nsresult rv = aPresContext->IsPaginated(&isPaginated); - if (NS_SUCCEEDED(rv) && isPaginated) { + if (aPresContext->IsPaginated()) { // now see if we are rendering selection only if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first (typically only leaf nodes) diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 276e58900b7..221d36d0146 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -402,9 +402,7 @@ nsSubDocumentFrame::Reflow(nsIPresContext* aPresContext, } } - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (!isPaginated) { + if (!aPresContext->IsPaginated()) { nsCOMPtr docShell; GetDocShell(getter_AddRefs(docShell)); diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index 9288b363fcc..f243b3f017a 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -342,9 +342,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, { // Don't create scrollbars if we're printing/print previewing // Get rid of this code when printing moves to its own presentation - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { // allow scrollbars if this is the child of the viewport, because // we must be the scrollbars for the print preview window nsIFrame* parent = GetParent(); diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 862b458bad8..627b68db34b 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -880,8 +880,6 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, // we have to split images if we are: // in Paginated mode, we need to have a constrained height, and have a height larger than our available height - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); PRUint32 loadStatus = imgIRequest::STATUS_NONE; nsCOMPtr imageLoader = do_QueryInterface(mContent); NS_ASSERTION(imageLoader, "No content node??"); @@ -893,7 +891,7 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, currentRequest->GetImageStatus(&loadStatus); } } - if (isPaginated && + if (aPresContext->IsPaginated() && ((loadStatus & imgIRequest::STATUS_SIZE_AVAILABLE) || (mState & IMAGE_SIZECONSTRAINED)) && NS_UNCONSTRAINEDSIZE != aReflowState.availableHeight && aMetrics.height > aReflowState.availableHeight) { diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index 3d70ce07cf0..f37a658bdde 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -755,9 +755,7 @@ NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) //check that we are only creating page break frames when printing nsCOMPtr presContext; aPresShell->GetPresContext(getter_AddRefs(presContext)); - PRBool isPaginated; - presContext->IsPaginated(&isPaginated); - NS_ASSERTION(isPaginated, "created a page break frame while not printing"); + NS_ASSERTION(presContext->IsPaginated(), "created a page break frame while not printing"); #endif nsPageBreakFrame* it = new (aPresShell) nsPageBreakFrame; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 353277187a2..9b7378f116b 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -2011,11 +2011,11 @@ nsresult nsTextFrame::GetTextInfoForPainting(nsIPresContext* aPresConte if (NS_FAILED(rv) || !(*aSelectionController)) return NS_ERROR_FAILURE; - aPresContext->IsPaginated(&aIsPaginated); + aIsPaginated = aPresContext->IsPaginated(); (*aSelectionController)->GetDisplaySelection(&aSelectionValue); - if(aIsPaginated){ + if (aIsPaginated) { aDisplayingSelection = aPresContext->IsRenderingOnlySelection(); } else { //if greater than hidden then we display some kind of selection @@ -2156,9 +2156,7 @@ nsTextFrame::IsVisibleForPainting(nsIPresContext * aPresContext, // Start by assuming we are visible and need to be painted PRBool isVisible = PR_TRUE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT; diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 3eefd27d9b0..bb12228de09 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -2776,12 +2776,11 @@ nsresult nsFrame::GetSelectionForVisCheck(nsIPresContext * aPresContext, nsISelection** aSelection) { *aSelection = nsnull; + nsresult rv = NS_OK; // start by checking to see if we are paginated which probably means // we are in print preview or printing - PRBool isPaginated; - nsresult rv = aPresContext->IsPaginated(&isPaginated); - if (NS_SUCCEEDED(rv) && isPaginated) { + if (aPresContext->IsPaginated()) { // now see if we are rendering selection only if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first (typically only leaf nodes) diff --git a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp index 9288b363fcc..f243b3f017a 100644 --- a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp @@ -342,9 +342,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, { // Don't create scrollbars if we're printing/print previewing // Get rid of this code when printing moves to its own presentation - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { // allow scrollbars if this is the child of the viewport, because // we must be the scrollbars for the print preview window nsIFrame* parent = GetParent(); diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 862b458bad8..627b68db34b 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -880,8 +880,6 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, // we have to split images if we are: // in Paginated mode, we need to have a constrained height, and have a height larger than our available height - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); PRUint32 loadStatus = imgIRequest::STATUS_NONE; nsCOMPtr imageLoader = do_QueryInterface(mContent); NS_ASSERTION(imageLoader, "No content node??"); @@ -893,7 +891,7 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext, currentRequest->GetImageStatus(&loadStatus); } } - if (isPaginated && + if (aPresContext->IsPaginated() && ((loadStatus & imgIRequest::STATUS_SIZE_AVAILABLE) || (mState & IMAGE_SIZECONSTRAINED)) && NS_UNCONSTRAINEDSIZE != aReflowState.availableHeight && aMetrics.height > aReflowState.availableHeight) { diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp index 3d70ce07cf0..f37a658bdde 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ b/mozilla/layout/html/base/src/nsPageFrame.cpp @@ -755,9 +755,7 @@ NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) //check that we are only creating page break frames when printing nsCOMPtr presContext; aPresShell->GetPresContext(getter_AddRefs(presContext)); - PRBool isPaginated; - presContext->IsPaginated(&isPaginated); - NS_ASSERTION(isPaginated, "created a page break frame while not printing"); + NS_ASSERTION(presContext->IsPaginated(), "created a page break frame while not printing"); #endif nsPageBreakFrame* it = new (aPresShell) nsPageBreakFrame; diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index cfefbd9b1ee..c49d6ef6ff2 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -2862,9 +2862,7 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) } // For printing, we just immediately unsuppress. - PRBool isPaginated = PR_FALSE; - mPresContext->IsPaginated(&isPaginated); - if (!isPaginated) { + if (!mPresContext->IsPaginated()) { // Kick off a one-shot timer based off our pref value. When this timer // fires, if painting is still locked down, then we will go ahead and // trigger a full invalidate and allow painting to proceed normally. @@ -6944,9 +6942,7 @@ PresShell::VerifyIncrementalReflow() // Create a presentation context to view the new frame tree nsresult rv; - PRBool isPaginated = PR_FALSE; - mPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (mPresContext->IsPaginated()) { nsCOMPtr ppx = do_CreateInstance(kPrintPreviewContextCID, &rv); if (NS_SUCCEEDED(rv)) { ppx->QueryInterface(NS_GET_IID(nsIPresContext),(void**)&cx); diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 353277187a2..9b7378f116b 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -2011,11 +2011,11 @@ nsresult nsTextFrame::GetTextInfoForPainting(nsIPresContext* aPresConte if (NS_FAILED(rv) || !(*aSelectionController)) return NS_ERROR_FAILURE; - aPresContext->IsPaginated(&aIsPaginated); + aIsPaginated = aPresContext->IsPaginated(); (*aSelectionController)->GetDisplaySelection(&aSelectionValue); - if(aIsPaginated){ + if (aIsPaginated) { aDisplayingSelection = aPresContext->IsRenderingOnlySelection(); } else { //if greater than hidden then we display some kind of selection @@ -2156,9 +2156,7 @@ nsTextFrame::IsVisibleForPainting(nsIPresContext * aPresContext, // Start by assuming we are visible and need to be painted PRBool isVisible = PR_TRUE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT; diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 276e58900b7..221d36d0146 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -402,9 +402,7 @@ nsSubDocumentFrame::Reflow(nsIPresContext* aPresContext, } } - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (!isPaginated) { + if (!aPresContext->IsPaginated()) { nsCOMPtr docShell; GetDocShell(getter_AddRefs(docShell)); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index e21e65af6f5..ddf75190771 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1943,9 +1943,7 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp index 9d268452cf1..c61ff00385c 100644 --- a/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -387,9 +387,7 @@ nsGfxButtonControlFrame::HandleEvent(nsIPresContext* aPresContext, nsEventStatus* aEventStatus) { // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } // Override the HandleEvent to prevent the nsFrame::HandleEvent diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 1bc02a88c50..ac31b9663a5 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -527,9 +527,7 @@ nsListControlFrame::Paint(nsIPresContext* aPresContext, // Start by assuming we are visible and need to be painted PRBool isVisible = PR_TRUE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { if (aPresContext->IsRenderingOnlySelection()) { // Check the quick way first PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT; @@ -1713,9 +1711,7 @@ nsListControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index f3663bedfa3..f15d89ed6b9 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -1208,7 +1208,7 @@ SuppressEventHandlers(nsIPresContext* aPresContext) // In the current implementation, we only paginate when // printing or in print preview. - aPresContext->IsPaginated(&suppressHandlers); + suppressHandlers = aPresContext->IsPaginated(); #endif } @@ -3126,9 +3126,7 @@ nsTextControlFrame::HandleEvent(nsIPresContext* aPresContext, NS_ENSURE_ARG_POINTER(aEventStatus); // temp fix until Bug 124990 gets fixed - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) { + if (aPresContext->IsPaginated() && NS_IS_MOUSE_EVENT(aEvent)) { return NS_OK; } diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index e01464cdc2d..0957416ddf7 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -821,9 +821,7 @@ AdjustAbsoluteContainingBlock(nsIPresContext* aPresContext, nsIFrame* aContainingBlockIn) { nsIFrame* containingBlock = aContainingBlockIn; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (!paginated) { + if (!aPresContext->IsPaginated()) { if (nsLayoutAtoms::positionedInlineFrame == containingBlock->GetType()) { containingBlock = ((nsPositionedInlineFrame*)containingBlock)->GetFirstInFlow(); } @@ -3059,10 +3057,8 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresShell* aPresShell, case NS_STYLE_DISPLAY_TABLE: { PRBool pageBreakAfter = PR_FALSE; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (paginated) { + if (aPresContext->IsPaginated()) { // See if there is a page break before, if so construct one. Also see if there is one after pageBreakAfter = PageBreakBefore(aPresShell, aPresContext, aState, aChildContent, aParentFrame, childStyleContext, aChildItems); @@ -3309,14 +3305,12 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, // --------- IF SCROLLABLE WRAP IN SCROLLFRAME -------- PRBool isScrollable = IsScrollable(aPresContext, display); - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); nsCOMPtr printPreviewContext(do_QueryInterface(aPresContext)); nsIFrame* scrollFrame = nsnull; // build a scrollframe - if ((!isPaginated || (isPaginated && printPreviewContext)) && isScrollable) { + if ((!aPresContext->IsPaginated() || printPreviewContext) && isScrollable) { nsIFrame* newScrollFrame = nsnull; nsRefPtr newContext; @@ -3566,8 +3560,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, // - renders the document element's background. This ensures the background covers // the entire canvas as specified by the CSS2 spec - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsCOMPtr printPreviewContext(do_QueryInterface(aPresContext)); nsIFrame* rootFrame = nsnull; @@ -3649,7 +3642,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, if (isPaginated) { if (printPreviewContext) { // print preview - aPresContext->GetPaginatedScrolling(&isScrollable); + isScrollable = aPresContext->HasPaginatedScrolling(); } else { isScrollable = PR_FALSE; // we are printing } @@ -3808,7 +3801,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell, rootFrame->Init(aPresContext, aDocElement, parentFrame, rootPseudoStyle, nsnull); - if (!isPaginated || (isPaginated && printPreviewContext)) { + if (!isPaginated || printPreviewContext) { if (isScrollable) { FinishBuildingScrollFrame(aPresContext, state, @@ -6943,10 +6936,8 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresShell* aPresShell, aContent->GetNameSpaceID(&nameSpaceID); PRBool pageBreakAfter = PR_FALSE; - PRBool paginated; - aPresContext->IsPaginated(&paginated); - if (paginated) { + if (aPresContext->IsPaginated()) { // See if there is a page break before, if so construct one. Also see if there is one after pageBreakAfter = PageBreakBefore(aPresShell, aPresContext, aState, aContent, aParentFrame, styleContext, aFrameItems); diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index fe47d06d475..f7d3430e164 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -3005,9 +3005,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, aPresContext->PresShell()->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame, "no root frame"); - PRBool isPaginated = PR_FALSE; - aPresContext->IsPaginated(&isPaginated); - if (isPaginated) { + if (aPresContext->IsPaginated()) { nsIFrame* page = nsLayoutUtils::GetPageFrame(aForFrame); NS_ASSERTION(page, "no page"); rootFrame = page; diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 36876cdb6d3..2bcfaf7d94c 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -836,8 +836,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, SetPriorAvailWidth(aReflowState.availableWidth); nsIFrame* firstKid = mFrames.FirstChild(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); nscoord computedPaginatedHeight = 0; if (aReflowState.mFlags.mSpecialHeightReflow || @@ -845,7 +843,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, ((nsHTMLReflowState&)aReflowState).mComputedHeight = mRect.height - topInset - bottomInset; DISPLAY_REFLOW_CHANGE(); } - else if (isPaginated) { + else if (aPresContext->IsPaginated()) { computedPaginatedHeight = CalcUnpaginagedHeight(aPresContext, (nsTableCellFrame&)*this, *tableFrame, topInset + bottomInset); if (computedPaginatedHeight > 0) { ((nsHTMLReflowState&)aReflowState).mComputedHeight = computedPaginatedHeight; diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 6b9889f51c5..39747e63ccd 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -1856,8 +1856,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext, #if defined DEBUG_TABLE_REFLOW_TIMING nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState); #endif - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); // If this is a special height reflow, set our desired size to what is was previously and return // if we will be getting another special height reflow. In paginated mode, SetNeedSpecialReflow(PR_TRUE) @@ -2118,9 +2117,6 @@ nsTableFrame::ReflowTable(nsIPresContext* aPresContext, aDidBalance = PR_FALSE; aLastChildReflowed = nsnull; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - PRBool haveReflowedColGroups = PR_TRUE; if (!mPrevInFlow) { if (NeedStrategyInit()) { @@ -3156,8 +3152,7 @@ nsTableFrame::ReflowChildren(nsIPresContext* aPresContext, nsresult rv = NS_OK; nscoord cellSpacingY = GetCellSpacingY(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); aOverflowArea = nsRect (0, 0, 0, 0); diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 4120a71d675..38d79eb46d9 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -1925,13 +1925,11 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext, } aStatus = NS_FRAME_COMPLETE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); PRBool needUpdateMetrics = PR_TRUE; if ((eReflowReason_Resize == aOuterRS.reason) && (aOuterRS.availableWidth == mPriorAvailWidth) && - !isPaginated && + !aPresContext->IsPaginated() && !::IsPctHeight(mInnerTableFrame)) { // don't do much if we are resize reflowed exactly like last time aDesiredSize.width = mRect.width; diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index 49c5c9f272a..1670119d6c8 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -796,8 +796,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, nsIFrame* tablePrevInFlow; aTableFrame.GetPrevInFlow(&tablePrevInFlow); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsresult rv = NS_OK; diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 2fa9aa59b04..380dd48c24c 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -345,8 +345,7 @@ nsTableRowGroupFrame::ReflowChildren(nsIPresContext* aPresContext, nscoord cellSpacingY = tableFrame->GetCellSpacingY(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); if (aFirstRowReflowed) { *aFirstRowReflowed = nsnull; @@ -564,8 +563,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext, nsTableFrame::GetTableFrame(this, tableFrame); if (!aPresContext || !tableFrame) return; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); // all table cells have the same top and bottom margins, namely cellSpacingY nscoord cellSpacingY = tableFrame->GetCellSpacingY(); @@ -1244,8 +1242,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext, nsresult rv = NS_OK; aStatus = NS_FRAME_COMPLETE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsTableFrame* tableFrame = nsnull; rv = nsTableFrame::GetTableFrame(this, tableFrame); diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 36876cdb6d3..2bcfaf7d94c 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -836,8 +836,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, SetPriorAvailWidth(aReflowState.availableWidth); nsIFrame* firstKid = mFrames.FirstChild(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); nscoord computedPaginatedHeight = 0; if (aReflowState.mFlags.mSpecialHeightReflow || @@ -845,7 +843,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, ((nsHTMLReflowState&)aReflowState).mComputedHeight = mRect.height - topInset - bottomInset; DISPLAY_REFLOW_CHANGE(); } - else if (isPaginated) { + else if (aPresContext->IsPaginated()) { computedPaginatedHeight = CalcUnpaginagedHeight(aPresContext, (nsTableCellFrame&)*this, *tableFrame, topInset + bottomInset); if (computedPaginatedHeight > 0) { ((nsHTMLReflowState&)aReflowState).mComputedHeight = computedPaginatedHeight; diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 6b9889f51c5..39747e63ccd 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1856,8 +1856,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext, #if defined DEBUG_TABLE_REFLOW_TIMING nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState); #endif - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); // If this is a special height reflow, set our desired size to what is was previously and return // if we will be getting another special height reflow. In paginated mode, SetNeedSpecialReflow(PR_TRUE) @@ -2118,9 +2117,6 @@ nsTableFrame::ReflowTable(nsIPresContext* aPresContext, aDidBalance = PR_FALSE; aLastChildReflowed = nsnull; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); - PRBool haveReflowedColGroups = PR_TRUE; if (!mPrevInFlow) { if (NeedStrategyInit()) { @@ -3156,8 +3152,7 @@ nsTableFrame::ReflowChildren(nsIPresContext* aPresContext, nsresult rv = NS_OK; nscoord cellSpacingY = GetCellSpacingY(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); aOverflowArea = nsRect (0, 0, 0, 0); diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 4120a71d675..38d79eb46d9 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -1925,13 +1925,11 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext, } aStatus = NS_FRAME_COMPLETE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); PRBool needUpdateMetrics = PR_TRUE; if ((eReflowReason_Resize == aOuterRS.reason) && (aOuterRS.availableWidth == mPriorAvailWidth) && - !isPaginated && + !aPresContext->IsPaginated() && !::IsPctHeight(mInnerTableFrame)) { // don't do much if we are resize reflowed exactly like last time aDesiredSize.width = mRect.width; diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index 49c5c9f272a..1670119d6c8 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -796,8 +796,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, nsIFrame* tablePrevInFlow; aTableFrame.GetPrevInFlow(&tablePrevInFlow); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsresult rv = NS_OK; diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 2fa9aa59b04..380dd48c24c 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -345,8 +345,7 @@ nsTableRowGroupFrame::ReflowChildren(nsIPresContext* aPresContext, nscoord cellSpacingY = tableFrame->GetCellSpacingY(); - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); if (aFirstRowReflowed) { *aFirstRowReflowed = nsnull; @@ -564,8 +563,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext* aPresContext, nsTableFrame::GetTableFrame(this, tableFrame); if (!aPresContext || !tableFrame) return; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); // all table cells have the same top and bottom margins, namely cellSpacingY nscoord cellSpacingY = tableFrame->GetCellSpacingY(); @@ -1244,8 +1242,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext, nsresult rv = NS_OK; aStatus = NS_FRAME_COMPLETE; - PRBool isPaginated; - aPresContext->IsPaginated(&isPaginated); + PRBool isPaginated = aPresContext->IsPaginated(); nsTableFrame* tableFrame = nsnull; rv = nsTableFrame::GetTableFrame(this, tableFrame);