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
This commit is contained in:
bzbarsky%mit.edu
2005-10-23 22:11:27 +00:00
parent 26d108cb4a
commit ebec986940
3 changed files with 7 additions and 23 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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;