From ebec986940927bc2cb5039fbabd9caf99bf54fbc Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sun, 23 Oct 2005 22:11:27 +0000 Subject: [PATCH] Fix bug 313498 -- no need for aPresContext in GetOptionsContainer. r+sr=roc. git-svn-id: svn://10.0.0.236/trunk@182852 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsIListControlFrame.h | 6 ------ mozilla/layout/forms/nsListControlFrame.cpp | 19 +++---------------- mozilla/layout/forms/nsListControlFrame.h | 5 ++++- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/mozilla/layout/forms/nsIListControlFrame.h b/mozilla/layout/forms/nsIListControlFrame.h index 9f0a461915e..0ae51658cec 100644 --- a/mozilla/layout/forms/nsIListControlFrame.h +++ b/mozilla/layout/forms/nsIListControlFrame.h @@ -117,12 +117,6 @@ public: */ NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) = 0; - /** - * Return the the frame that the options will be inserted into - */ - NS_IMETHOD GetOptionsContainer(nsPresContext* aPresContext, - nsIFrame** aFrame) = 0; - /** * Tell the selected list to roll up and ensure that the proper index is * selected, possibly firing onChange if the index has changed diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index cd9fe41bdac..948024a0699 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -436,8 +436,7 @@ void nsListControlFrame::PaintFocus(nsIRenderingContext& aRC, nsFramePaintLayer nsIPresShell *presShell = presContext->GetPresShell(); if (!presShell) return; - nsIFrame* containerFrame; - GetOptionsContainer(presContext, &containerFrame); + nsIFrame* containerFrame = GetOptionsContainer(); if (!containerFrame) return; nsIFrame * childframe = nsnull; @@ -931,9 +930,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext, // list by using the tallest of the grandchildren, since there may be // option groups in addition to option elements, either of which may // be visible or invisible. - nsIFrame *optionsContainer; - GetOptionsContainer(aPresContext, &optionsContainer); - PRInt32 heightOfARow = GetMaxOptionHeight(optionsContainer); + PRInt32 heightOfARow = GetMaxOptionHeight(GetOptionsContainer()); // Check to see if we have zero items PRInt32 length = 0; @@ -1214,9 +1211,7 @@ nsListControlFrame::IsOptionElement(nsIContent* aContent) nsIFrame* nsListControlFrame::GetContentInsertionFrame() { - nsIFrame* frame; - GetOptionsContainer(GetPresContext(), &frame); - return frame->GetContentInsertionFrame(); + return GetOptionsContainer()->GetContentInsertionFrame(); } //--------------------------------------------------------- @@ -2167,14 +2162,6 @@ nsListControlFrame::ComboboxFinish(PRInt32 aIndex) return NS_OK; } -NS_IMETHODIMP -nsListControlFrame::GetOptionsContainer(nsPresContext* aPresContext, - nsIFrame** aFrame) -{ - *aFrame = GetScrolledFrame(); - return NS_OK; -} - // Send out an onchange notification. NS_IMETHODIMP nsListControlFrame::FireOnChange() diff --git a/mozilla/layout/forms/nsListControlFrame.h b/mozilla/layout/forms/nsListControlFrame.h index 7c4e430dcec..1d96ffcc2c5 100644 --- a/mozilla/layout/forms/nsListControlFrame.h +++ b/mozilla/layout/forms/nsListControlFrame.h @@ -171,7 +171,6 @@ public: NS_IMETHOD AboutToRollup(); NS_IMETHOD UpdateSelection(); NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) { mOverrideReflowOpt = aValue; return NS_OK; } - NS_IMETHOD GetOptionsContainer(nsPresContext* aPresContext, nsIFrame** aFrame); NS_IMETHOD FireOnChange(); NS_IMETHOD ComboboxFinish(PRInt32 aIndex); @@ -260,6 +259,10 @@ protected: PRBool HandleListSelection(nsIDOMEvent * aDOMEvent, PRInt32 selectedIndex); void InitSelectionRange(PRInt32 aClickedIndex); + nsIFrame* GetOptionsContainer() { + return GetScrolledFrame(); + } + // Data Members PRInt32 mStartSelectionIndex; PRInt32 mEndSelectionIndex;