From 2260749166c0bef5ad4a1cc6a9684fb9ee1e4b43 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Fri, 3 Sep 2004 23:28:26 +0000 Subject: [PATCH] Land bug 72747 in pieces: Remove mNeverHas*Scrollbar variables which are unneeded since the m*ScrollbarBox null-checks handle their one remaining user. b=72747 r+sr=roc --- layout/generic/nsGfxScrollFrame.cpp | 7 ++----- layout/generic/nsGfxScrollFrame.h | 3 --- layout/html/base/src/nsGfxScrollFrame.cpp | 7 ++----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 9066b3af5c8..8d113e9cc7a 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1136,8 +1136,6 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsBoxFrame* aOuter) mOuter(aOuter), mMaxElementWidth(0), mLastDir(-1), - mNeverHasVerticalScrollbar(PR_FALSE), - mNeverHasHorizontalScrollbar(PR_FALSE), mHasVerticalScrollbar(PR_FALSE), mHasHorizontalScrollbar(PR_FALSE), mFirstPass(PR_FALSE), @@ -1264,7 +1262,6 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsISupportsArray& aAnonymousChildr // allow scrollbars if this is the child of the viewport, because // we must be the scrollbars for the print preview window if (!parent || parent->GetType() != nsLayoutAtoms::viewportFrame) { - mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = PR_TRUE; return; } } @@ -1556,7 +1553,7 @@ PRBool nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScrollAreaSize, PRBool aOnTop, PRBool aHorizontal, PRBool aAdd) { if (aHorizontal) { - if (mNeverHasHorizontalScrollbar || !mHScrollbarBox) + if (!mHScrollbarBox) return PR_FALSE; nsSize hSize; @@ -1573,7 +1570,7 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr return fit; } else { - if (mNeverHasVerticalScrollbar || !mVScrollbarBox) + if (!mVScrollbarBox) return PR_FALSE; nsSize vSize; diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index a1dc81372aa..bf96f23316f 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -143,9 +143,6 @@ public: // value that indicates "not set") PRInt16 mLastDir; - PRPackedBool mNeverHasVerticalScrollbar; - PRPackedBool mNeverHasHorizontalScrollbar; - PRPackedBool mHasVerticalScrollbar; PRPackedBool mHasHorizontalScrollbar; PRPackedBool mFirstPass; diff --git a/layout/html/base/src/nsGfxScrollFrame.cpp b/layout/html/base/src/nsGfxScrollFrame.cpp index 9066b3af5c8..8d113e9cc7a 100644 --- a/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/layout/html/base/src/nsGfxScrollFrame.cpp @@ -1136,8 +1136,6 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsBoxFrame* aOuter) mOuter(aOuter), mMaxElementWidth(0), mLastDir(-1), - mNeverHasVerticalScrollbar(PR_FALSE), - mNeverHasHorizontalScrollbar(PR_FALSE), mHasVerticalScrollbar(PR_FALSE), mHasHorizontalScrollbar(PR_FALSE), mFirstPass(PR_FALSE), @@ -1264,7 +1262,6 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsISupportsArray& aAnonymousChildr // allow scrollbars if this is the child of the viewport, because // we must be the scrollbars for the print preview window if (!parent || parent->GetType() != nsLayoutAtoms::viewportFrame) { - mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = PR_TRUE; return; } } @@ -1556,7 +1553,7 @@ PRBool nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScrollAreaSize, PRBool aOnTop, PRBool aHorizontal, PRBool aAdd) { if (aHorizontal) { - if (mNeverHasHorizontalScrollbar || !mHScrollbarBox) + if (!mHScrollbarBox) return PR_FALSE; nsSize hSize; @@ -1573,7 +1570,7 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr return fit; } else { - if (mNeverHasVerticalScrollbar || !mVScrollbarBox) + if (!mVScrollbarBox) return PR_FALSE; nsSize vSize;