Bug 313817. DeCOMtaminate a bunch of NS_New*Frame functions. patch by Marc Liddell, r+sr=roc

This commit is contained in:
roc+%cs.cmu.edu 2005-10-26 21:46:39 +00:00
parent 7a63edbaf4
commit 680ffaad50
61 changed files with 315 additions and 584 deletions

View File

@ -288,8 +288,8 @@ static FrameCtorDebugFlags gFlags[] = {
//------------------------------------------------------------------
nsresult
NS_NewAutoRepeatBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewAutoRepeatBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewRootBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
@ -300,73 +300,73 @@ NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsresult
NS_NewThumbFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsresult
NS_NewDeckFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame*
NS_NewDeckFrame (nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager = nsnull);
nsresult
NS_NewLeafBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewLeafBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewStackFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame*
NS_NewStackFrame (nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager = nsnull);
nsresult
NS_NewProgressMeterFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewProgressMeterFrame (nsIPresShell* aPresShell);
nsresult
NS_NewImageBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewImageBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewTextBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewTextBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewGroupBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewGroupBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewButtonBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewButtonBoxFrame (nsIPresShell* aPresShell);
nsresult
NS_NewGrippyFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewGrippyFrame (nsIPresShell* aPresShell);
nsresult
NS_NewSplitterFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewSplitterFrame (nsIPresShell* aPresShell);
nsresult
NS_NewMenuPopupFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewMenuPopupFrame (nsIPresShell* aPresShell);
nsresult
NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewPopupSetFrame(nsIPresShell* aPresShell);
nsresult
NS_NewMenuFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags );
nsIFrame*
NS_NewMenuFrame (nsIPresShell* aPresShell, PRUint32 aFlags);
nsresult
NS_NewMenuBarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewMenuBarFrame (nsIPresShell* aPresShell);
nsresult
NS_NewTreeBodyFrame (nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewTreeBodyFrame (nsIPresShell* aPresShell);
// grid
nsresult
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
nsresult
NS_NewGridRowLeafLayout ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
nsresult
NS_NewGridRowLeafFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsIFrame*
NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsresult
NS_NewGridRowGroupLayout ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
nsresult
NS_NewGridRowGroupFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsIFrame*
NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayout);
nsresult
NS_NewListBoxLayout ( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout );
// end grid
nsresult
NS_NewTitleBarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewTitleBarFrame (nsIPresShell* aPresShell);
nsresult
NS_NewResizerFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewResizerFrame (nsIPresShell* aPresShell);
#endif
@ -377,17 +377,17 @@ NS_NewHTMLScrollFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool a
nsresult
NS_NewXULScrollFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot);
nsresult
NS_NewSliderFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewSliderFrame (nsIPresShell* aPresShell);
nsresult
NS_NewScrollbarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewScrollbarFrame (nsIPresShell* aPresShell);
nsresult
NS_NewScrollbarButtonFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewScrollbarButtonFrame (nsIPresShell* aPresShell);
nsresult
NS_NewNativeScrollbarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsIFrame*
NS_NewNativeScrollbarFrame (nsIPresShell* aPresShell);
#ifdef NOISY_FINDFRAME
@ -4592,9 +4592,9 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
else
#endif
{
rv = NS_NewDocumentElementFrame(mPresShell, &contentFrame);
if (NS_FAILED(rv)) {
return rv;
contentFrame = NS_NewDocumentElementFrame(mPresShell);
if (NS_UNLIKELY(!contentFrame)) {
return NS_ERROR_OUT_OF_MEMORY;
}
isBlockFrame = PR_TRUE;
}
@ -5329,9 +5329,8 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
// positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
nsIFrame* areaFrame;
NS_NewAreaFrame(mPresShell, &areaFrame,
NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP);
nsIFrame* areaFrame =
NS_NewAreaFrame(mPresShell, NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP);
// Resolve style and initialize the frame
nsRefPtr<nsStyleContext> styleContext;
@ -5586,8 +5585,14 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
rv = NS_NewObjectFrame(mPresShell, &newFrame);
else if (type == nsIObjectLoadingContent::TYPE_IMAGE)
rv = NS_NewImageFrame(mPresShell, &newFrame);
else if (type == nsIObjectLoadingContent::TYPE_DOCUMENT)
rv = NS_NewSubDocumentFrame(mPresShell, &newFrame);
else if (type == nsIObjectLoadingContent::TYPE_DOCUMENT) {
newFrame = NS_NewSubDocumentFrame(mPresShell);
// xxx marc
if (!newFrame) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
}
#ifdef DEBUG
else
NS_ERROR("Shouldn't get here if we're not broken and not "
@ -5633,7 +5638,13 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
}
isReplaced = PR_TRUE;
rv = NS_NewSubDocumentFrame(mPresShell, &newFrame);
newFrame = NS_NewSubDocumentFrame(mPresShell);
// xxx marc
if (!newFrame) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
if (newFrame) {
// the nsSubDocumentFrame needs to know about its content parent during ::Init.
// there is no reasonable way to get the value there.
@ -6004,18 +6015,22 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
PRBool isXULNS = (aNameSpaceID == kNameSpaceID_XUL);
PRBool isXULDisplay = IsXULDisplayType(display);
PRBool triedFrame = PR_FALSE;
if (isXULNS || isXULDisplay) {
PRBool mayBeScrollable = PR_FALSE;
if (isXULNS) {
triedFrame = PR_TRUE;
// First try creating a frame based on the tag
// Make sure to keep IsSpecialContent in synch with this code
#ifdef MOZ_XUL
// BUTTON CONSTRUCTION
if (aTag == nsXULAtoms::button || aTag == nsXULAtoms::checkbox || aTag == nsXULAtoms::radio) {
isReplaced = PR_TRUE;
rv = NS_NewButtonBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewButtonBoxFrame(mPresShell);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6023,17 +6038,16 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// AUTOREPEATBUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::autorepeatbutton) {
isReplaced = PR_TRUE;
rv = NS_NewAutoRepeatBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewAutoRepeatBoxFrame(mPresShell);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
} // End of AUTOREPEATBUTTON CONSTRUCTION logic
// TITLEBAR CONSTRUCTION
else if (aTag == nsXULAtoms::titlebar) {
isReplaced = PR_TRUE;
rv = NS_NewTitleBarFrame(mPresShell, &newFrame);
newFrame = NS_NewTitleBarFrame(mPresShell);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6042,7 +6056,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// RESIZER CONSTRUCTION
else if (aTag == nsXULAtoms::resizer) {
isReplaced = PR_TRUE;
rv = NS_NewResizerFrame(mPresShell, &newFrame);
newFrame = NS_NewResizerFrame(mPresShell);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6050,32 +6064,32 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
else if (aTag == nsXULAtoms::image) {
isReplaced = PR_TRUE;
rv = NS_NewImageBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewImageBoxFrame(mPresShell);
}
else if (aTag == nsXULAtoms::spring ||
aTag == nsHTMLAtoms::spacer) {
isReplaced = PR_TRUE;
rv = NS_NewLeafBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewLeafBoxFrame(mPresShell);
}
else if (aTag == nsXULAtoms::treechildren) {
isReplaced = PR_TRUE;
rv = NS_NewTreeBodyFrame(mPresShell, &newFrame);
newFrame = NS_NewTreeBodyFrame(mPresShell);
}
else if (aTag == nsXULAtoms::treecol) {
isReplaced = PR_TRUE;
rv = NS_NewTreeColFrame(mPresShell, &newFrame);
newFrame = NS_NewTreeColFrame(mPresShell);
}
// TEXT CONSTRUCTION
else if (aTag == nsXULAtoms::text || aTag == nsHTMLAtoms::label ||
aTag == nsXULAtoms::description) {
if ((aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) &&
(! aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::value))) {
rv = NS_NewAreaFrame(mPresShell, &newFrame,
newFrame = NS_NewAreaFrame(mPresShell,
NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP | NS_BLOCK_MARGIN_ROOT);
}
else {
isReplaced = PR_TRUE;
rv = NS_NewTextBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewTextBoxFrame(mPresShell);
}
}
// End of TEXT CONSTRUCTION logic
@ -6088,7 +6102,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// that has custom reflow to prevent menu children
// from becoming part of the flow.
isReplaced = PR_TRUE;
rv = NS_NewMenuFrame(mPresShell, &newFrame, (aTag != nsXULAtoms::menuitem));
newFrame = NS_NewMenuFrame(mPresShell, (aTag != nsXULAtoms::menuitem));
}
else if (aTag == nsXULAtoms::menubar) {
#ifdef XP_MACOSX
@ -6116,23 +6130,23 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
}
#endif
rv = NS_NewMenuBarFrame(mPresShell, &newFrame);
newFrame = NS_NewMenuBarFrame(mPresShell);
}
else if (aTag == nsXULAtoms::popupgroup) {
// This frame contains child popups
isReplaced = PR_TRUE;
rv = NS_NewPopupSetFrame(mPresShell, &newFrame);
newFrame = NS_NewPopupSetFrame(mPresShell);
}
else if (aTag == nsXULAtoms::iframe || aTag == nsXULAtoms::editor ||
aTag == nsXULAtoms::browser) {
isReplaced = PR_TRUE;
rv = NS_NewSubDocumentFrame(mPresShell, &newFrame);
newFrame = NS_NewSubDocumentFrame(mPresShell);
}
// PROGRESS METER CONSTRUCTION
else if (aTag == nsXULAtoms::progressmeter) {
isReplaced = PR_TRUE;
rv = NS_NewProgressMeterFrame(mPresShell, &newFrame);
newFrame = NS_NewProgressMeterFrame(mPresShell);
}
// End of PROGRESS METER CONSTRUCTION logic
else
@ -6140,25 +6154,25 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// SLIDER CONSTRUCTION
if (aTag == nsXULAtoms::slider) {
isReplaced = PR_TRUE;
rv = NS_NewSliderFrame(mPresShell, &newFrame);
newFrame = NS_NewSliderFrame(mPresShell);
}
// End of SLIDER CONSTRUCTION logic
// SCROLLBAR CONSTRUCTION
else if (aTag == nsXULAtoms::scrollbar) {
isReplaced = PR_TRUE;
rv = NS_NewScrollbarFrame(mPresShell, &newFrame);
newFrame = NS_NewScrollbarFrame(mPresShell);
}
else if (aTag == nsXULAtoms::nativescrollbar) {
isReplaced = PR_TRUE;
rv = NS_NewNativeScrollbarFrame(mPresShell, &newFrame);
newFrame = NS_NewNativeScrollbarFrame(mPresShell);
}
// End of SCROLLBAR CONSTRUCTION logic
// SCROLLBUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::scrollbarbutton) {
isReplaced = PR_TRUE;
rv = NS_NewScrollbarButtonFrame(mPresShell, &newFrame);
newFrame = NS_NewScrollbarButtonFrame(mPresShell);
}
// End of SCROLLBUTTON CONSTRUCTION logic
@ -6166,27 +6180,33 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// SPLITTER CONSTRUCTION
else if (aTag == nsXULAtoms::splitter) {
isReplaced = PR_TRUE;
rv = NS_NewSplitterFrame(mPresShell, &newFrame);
newFrame = NS_NewSplitterFrame(mPresShell);
}
// End of SPLITTER CONSTRUCTION logic
// GRIPPY CONSTRUCTION
else if (aTag == nsXULAtoms::grippy) {
isReplaced = PR_TRUE;
rv = NS_NewGrippyFrame(mPresShell, &newFrame);
newFrame = NS_NewGrippyFrame(mPresShell);
}
// End of GRIPPY CONSTRUCTION logic
else {
triedFrame = PR_FALSE;
}
#endif
}
// Display types for XUL start here
// First is BOX
if (!newFrame && isXULDisplay) {
triedFrame = PR_TRUE;
if (display->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX ||
display->mDisplay == NS_STYLE_DISPLAY_BOX) {
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(mPresShell, &newFrame, PR_FALSE, nsnull);
newFrame = NS_NewBoxFrame(mPresShell, PR_FALSE, nsnull);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6198,7 +6218,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
isReplaced = PR_TRUE;
nsCOMPtr<nsIBoxLayout> layout;
NS_NewGridLayout2(mPresShell, getter_AddRefs(layout));
rv = NS_NewBoxFrame(mPresShell, &newFrame, PR_FALSE, layout);
newFrame = NS_NewBoxFrame(mPresShell, PR_FALSE, layout);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6213,14 +6233,14 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
if (aTag == nsXULAtoms::listboxbody) {
NS_NewListBoxLayout(mPresShell, layout);
rv = NS_NewListBoxBodyFrame(mPresShell, &newFrame, PR_FALSE, layout);
newFrame = NS_NewListBoxBodyFrame(mPresShell, PR_FALSE, layout);
((nsListBoxBodyFrame*)newFrame)->InitGroup(this,
aState.mPresContext);
}
else
{
NS_NewGridRowGroupLayout(mPresShell, getter_AddRefs(layout));
rv = NS_NewGridRowGroupFrame(mPresShell, &newFrame, PR_FALSE, layout);
newFrame = NS_NewGridRowGroupFrame(mPresShell, PR_FALSE, layout);
}
// Boxes can scroll.
@ -6248,9 +6268,9 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
NS_NewGridRowLeafLayout(mPresShell, getter_AddRefs(layout));
if (aTag == nsXULAtoms::listitem)
rv = NS_NewListItemFrame(mPresShell, &newFrame, PR_FALSE, layout);
newFrame = NS_NewListItemFrame(mPresShell, PR_FALSE, layout);
else
rv = NS_NewGridRowLeafFrame(mPresShell, &newFrame, PR_FALSE, layout);
newFrame = NS_NewGridRowLeafFrame(mPresShell, PR_FALSE, layout);
// Boxes can scroll.
mayBeScrollable = PR_TRUE;
@ -6259,11 +6279,11 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// DECK CONSTRUCTION
else if (display->mDisplay == NS_STYLE_DISPLAY_DECK) {
isReplaced = PR_TRUE;
rv = NS_NewDeckFrame(mPresShell, &newFrame);
newFrame = NS_NewDeckFrame(mPresShell);
}
// End of DECK CONSTRUCTION logic
else if (display->mDisplay == NS_STYLE_DISPLAY_GROUPBOX) {
rv = NS_NewGroupBoxFrame(mPresShell, &newFrame);
newFrame = NS_NewGroupBoxFrame(mPresShell);
isReplaced = PR_TRUE;
// Boxes can scroll.
@ -6274,7 +6294,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
display->mDisplay == NS_STYLE_DISPLAY_INLINE_STACK) {
isReplaced = PR_TRUE;
rv = NS_NewStackFrame(mPresShell, &newFrame);
newFrame = NS_NewStackFrame(mPresShell);
mayBeScrollable = PR_TRUE;
}
@ -6282,7 +6302,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// This is its own frame that derives from
// box.
isReplaced = PR_TRUE;
rv = NS_NewMenuPopupFrame(mPresShell, &newFrame);
newFrame = NS_NewMenuPopupFrame(mPresShell);
if (aTag == nsXULAtoms::tooltip) {
nsAutoString defaultTooltip;
@ -6307,7 +6327,11 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
nsCOMPtr<nsIMenuFrame> menuFrame(do_QueryInterface(aParentFrame));
if (!menuFrame)
isPopup = PR_TRUE;
}
}
else {
triedFrame = PR_FALSE;
}
#endif
}
@ -6325,6 +6349,11 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
frameHasBeenInitialized = PR_TRUE;
}
}
if (NS_UNLIKELY(triedFrame && !newFrame))
{
rv = NS_ERROR_OUT_OF_MEMORY;
}
// If we succeeded in creating a frame then initialize it, process its
// children (if requested), and set the initial child list
@ -6689,9 +6718,10 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
PR_FALSE, newFrame);
// Initialize it
nsIFrame* scrolledFrame = nsnull;
NS_NewAreaFrame(mPresShell, &scrolledFrame, NS_BLOCK_SPACE_MGR |
NS_BLOCK_SHRINK_WRAP | NS_BLOCK_MARGIN_ROOT);
nsIFrame* scrolledFrame =
NS_NewAreaFrame(mPresShell,
NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP | NS_BLOCK_MARGIN_ROOT);
nsFrameItems blockItem;
rv = ConstructBlock(aState,
scrolledContentStyle->GetStyleDisplay(), aContent,
@ -6719,7 +6749,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
}
// Create a frame to wrap up the absolute positioned item
NS_NewAbsoluteItemWrapperFrame(mPresShell, &newFrame);
newFrame = NS_NewAbsoluteItemWrapperFrame(mPresShell);
rv = ConstructBlock(aState, aDisplay, aContent,
aState.GetGeometricParent(aDisplay, aParentFrame), aParentFrame,
@ -6738,7 +6768,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
ProcessPseudoFrames(aState, aFrameItems);
}
// Create an area frame
NS_NewFloatingItemWrapperFrame(mPresShell, &newFrame);
newFrame = NS_NewFloatingItemWrapperFrame(mPresShell);
rv = ConstructBlock(aState, aDisplay, aContent,
aState.GetGeometricParent(aDisplay, aParentFrame),
@ -6762,7 +6792,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
if ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay)) {
// Create a wrapper frame. No space manager, though
NS_NewRelativeItemWrapperFrame(mPresShell, &newFrame);
newFrame = NS_NewRelativeItemWrapperFrame(mPresShell);
// XXXbz should we be passing in a non-null aContentParentFrame?
ConstructBlock(aState, aDisplay, aContent,
aParentFrame, nsnull, aStyleContext, &newFrame,
@ -10986,7 +11016,11 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
}
} else if (nsLayoutAtoms::areaFrame == frameType) {
rv = NS_NewAreaFrame(shell, &newFrame, 0);
newFrame = NS_NewAreaFrame(shell, 0);
if (NS_UNLIKELY(!newFrame)) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
if (NS_SUCCEEDED(rv)) {
newFrame->Init(aPresContext, content, aParentFrame, styleContext,
aFrame);
@ -12915,7 +12949,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
nsIFrame* blockFrame;
nsIAtom* blockStyle;
if (aIsPositioned) {
NS_NewRelativeItemWrapperFrame(mPresShell, &blockFrame);
blockFrame = NS_NewRelativeItemWrapperFrame(mPresShell);
blockStyle = nsCSSAnonBoxes::mozAnonymousPositionedBlock;
}
else {

View File

@ -124,9 +124,8 @@ nsHTMLButtonControlFrame::Init(nsPresContext* aPresContext,
flags |= NS_BLOCK_SHRINK_WRAP;
}
nsIFrame* areaFrame;
nsIPresShell *shell = aPresContext->PresShell();
NS_NewAreaFrame(shell, &areaFrame, flags);
nsIFrame* areaFrame = NS_NewAreaFrame(shell, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame

View File

@ -55,20 +55,15 @@
#undef NOISY_MAX_ELEMENT_SIZE
#undef NOISY_FINAL_SIZE
nsresult
NS_NewAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags)
nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAreaFrame* it = new (aPresShell) nsAreaFrame;
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
if (it != nsnull)
it->SetFlags(aFlags);
return it;
}
nsAreaFrame::nsAreaFrame()

View File

@ -54,7 +54,7 @@ struct nsStylePosition;
class nsAreaFrame : public nsBlockFrame
{
public:
friend nsresult NS_NewAreaFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags);
friend nsIFrame* NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
// nsIFrame

View File

@ -519,19 +519,10 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
return NS_OK;
}
nsresult
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSubDocumentFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSubDocumentFrame* it = new (aPresShell) nsSubDocumentFrame;
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSubDocumentFrame;
}
NS_IMETHODIMP

View File

@ -422,8 +422,8 @@ nsHTMLFramesetFrame::Init(nsPresContext* aPresContext,
mChildBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
result = NS_NewSubDocumentFrame(shell, &frame);
if (NS_FAILED(result))
frame = NS_NewSubDocumentFrame(shell);
if (NS_UNLIKELY(!frame))
return NS_ERROR_OUT_OF_MEMORY;
result = frame->Init(aPresContext, child, this, kidSC, nsnull);

View File

@ -102,9 +102,8 @@ NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
PRUint32 aFlags);
// Create a basic area frame.
nsresult
NS_NewAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
PRUint32 aFlags);
nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
// These AreaFrame's shrink wrap around their contents
inline nsresult
@ -115,28 +114,28 @@ NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
// This type of AreaFrame is the document root, a margin root, and the
// initial containing block for absolutely positioned elements
inline nsresult
NS_NewDocumentElementFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
inline nsIFrame*
NS_NewDocumentElementFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame is a margin root, but does not shrink wrap
inline nsresult
NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
inline nsIFrame*
NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame shrink wraps
inline nsresult
NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aPresShell, aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP|NS_BLOCK_MARGIN_ROOT);
inline nsIFrame*
NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_SHRINK_WRAP|NS_BLOCK_MARGIN_ROOT);
}
// This type of AreaFrame doesn't use its own space manager and
// doesn't shrink wrap.
inline nsresult
NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
return NS_NewAreaFrame(aPresShell, aNewFrame, 0);
inline nsIFrame*
NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell) {
return NS_NewAreaFrame(aPresShell, 0);
}
nsresult
@ -146,8 +145,8 @@ nsresult
NS_NewCommentFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
// <frame> and <iframe>
nsresult
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
nsIFrame*
NS_NewSubDocumentFrame(nsIPresShell* aPresShell);
// <frameset>
nsresult
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);

View File

@ -48,20 +48,11 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
nsresult
NS_NewGridRowGroupFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsGridRowGroupFrame* it = new (aPresShell) nsGridRowGroupFrame (aPresShell, aIsRoot, aLayoutManager);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return
new (aPresShell) nsGridRowGroupFrame (aPresShell, aIsRoot, aLayoutManager);
}
nsGridRowGroupFrame::nsGridRowGroupFrame(nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)

View File

@ -52,7 +52,7 @@ class nsGridRowGroupFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewGridRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewGridRowGroupFrame(nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const

View File

@ -48,20 +48,10 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
nsresult
NS_NewGridRowLeafFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewGridRowLeafFrame ( nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsGridRowLeafFrame* it = new (aPresShell) nsGridRowLeafFrame (aPresShell, aIsRoot, aLayoutManager);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsGridRowLeafFrame (aPresShell, aIsRoot, aLayoutManager);
}
nsGridRowLeafFrame::nsGridRowLeafFrame(nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)

View File

@ -52,7 +52,7 @@ class nsGridRowLeafFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewGridRowLeafFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewGridRowLeafFrame(nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const

View File

@ -128,22 +128,10 @@ PRBool nsBoxFrame::gDebug = PR_FALSE;
nsIBox* nsBoxFrame::mDebugChild = nsnull;
#endif
nsresult
NS_NewBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewBoxFrame(nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsBoxFrame* it = new (aPresShell) nsBoxFrame(aPresShell, aIsRoot, aLayoutManager);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsBoxFrame(aPresShell, aIsRoot, aLayoutManager);
} // NS_NewBoxFrame
nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)

View File

@ -73,19 +73,17 @@ class nsHTMLInfo;
#define NS_STATE_EQUAL_SIZE 0x40000000
//#define NS_STATE_IS_DIRECTION_NORMAL 0x80000000 moved to nsIFrame.h
nsresult NS_NewBoxFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
class nsBoxFrame : public nsContainerFrame
{
public:
friend nsresult NS_NewBoxFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
// gets the rect inside our border and debug border. If you wish to paint inside a box
// call this method to get the rect so you don't draw on the debug border or outer border.

View File

@ -55,23 +55,12 @@
//
// NS_NewXULButtonFrame
//
// Creates a new Button frame and returns it in |aNewFrame|
// Creates a new Button frame and returns it
//
nsresult
NS_NewButtonBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewButtonBoxFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsButtonBoxFrame* it = new (aPresShell) nsButtonBoxFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
// it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsButtonBoxFrame(aPresShell);
} // NS_NewXULButtonFrame
nsButtonBoxFrame::nsButtonBoxFrame(nsIPresShell* aPresShell)

View File

@ -43,7 +43,7 @@
class nsButtonBoxFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewButtonBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewButtonBoxFrame(nsIPresShell* aPresShell);
nsButtonBoxFrame(nsIPresShell* aPresShell);

View File

@ -57,21 +57,10 @@
#include "nsBoxLayoutState.h"
#include "nsStackLayout.h"
nsresult
NS_NewDeckFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewDeckFrame(nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (!aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsDeckFrame* it = new (aPresShell) nsDeckFrame(aPresShell, aLayoutManager);
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsDeckFrame(aPresShell, aLayoutManager);
} // NS_NewDeckFrame

View File

@ -52,9 +52,8 @@ class nsDeckFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewDeckFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewDeckFrame(nsIPresShell* aPresShell,
nsIBoxLayout* aLayoutManager);
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,

View File

@ -65,22 +65,12 @@
//
// NS_NewToolbarFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewGrippyFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewGrippyFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsGrippyFrame* it = new (aPresShell) nsGrippyFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsGrippyFrame (aPresShell);
} // NS_NewGrippyFrame
nsGrippyFrame::nsGrippyFrame(nsIPresShell* aShell):nsButtonBoxFrame(aShell),mCollapsed(PR_FALSE)

View File

@ -54,7 +54,7 @@ class nsGrippyFrame : public nsButtonBoxFrame
{
public:
friend nsresult NS_NewGrippyFrame(nsIFrame** aNewFrame);
friend nsIFrame* NS_NewGrippyFrame(nsIPresShell* aPresShell);
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;

View File

@ -91,20 +91,10 @@ public:
};
*/
nsresult
NS_NewGroupBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewGroupBoxFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsGroupBoxFrame* it = new (aPresShell) nsGroupBoxFrame(aPresShell);
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsGroupBoxFrame(aPresShell);
}
nsGroupBoxFrame::nsGroupBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell)

View File

@ -226,22 +226,12 @@ FireDOMEvent(nsIContent* aContent, PRUint32 aMessage)
//
// NS_NewImageBoxFrame
//
// Creates a new image frame and returns it in |aNewFrame|
// Creates a new image frame and returns it
//
nsresult
NS_NewImageBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewImageBoxFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsImageBoxFrame* it = new (aPresShell) nsImageBoxFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsImageBoxFrame (aPresShell);
} // NS_NewTitledButtonFrame
NS_IMETHODIMP

View File

@ -72,7 +72,7 @@ public:
NS_IMETHOD GetAscent(nsBoxLayoutState& aBoxLayoutState, nscoord& aAscent);
NS_IMETHOD NeedsRecalc();
friend nsresult NS_NewImageBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewImageBoxFrame(nsIPresShell* aPresShell);
// nsIBox frame interface

View File

@ -62,26 +62,15 @@
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
//
// NS_NewToolbarFrame
// NS_NewLeafBoxFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewLeafBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewLeafBoxFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsLeafBoxFrame* it = new (aPresShell) nsLeafBoxFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
// it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
} // NS_NewTextFrame
return new (aPresShell) nsLeafBoxFrame(aPresShell);
} // NS_NewLeafBoxFrame
nsLeafBoxFrame::nsLeafBoxFrame(nsIPresShell* aShell)
: mMouseThrough(unset)

View File

@ -46,7 +46,7 @@ class nsLeafBoxFrame : public nsLeafFrame
{
public:
friend nsresult NS_NewLeafBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewLeafBoxFrame(nsIPresShell* aPresShell);
NS_DECL_ISUPPORTS_INHERITED

View File

@ -1436,19 +1436,10 @@ nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
// Creation Routines ///////////////////////////////////////////////////////////////////////
nsresult
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot,
nsIFrame*
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsListBoxBodyFrame* it = new (aPresShell) nsListBoxBodyFrame(aPresShell, aIsRoot, aLayoutManager);
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return
new (aPresShell) nsListBoxBodyFrame(aPresShell, aIsRoot, aLayoutManager);
}

View File

@ -51,10 +51,9 @@
class nsCSSFrameConstructor;
class nsListScrollSmoother;
nsresult NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame* NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
class nsListBoxBodyFrame : public nsBoxFrame,
public nsIListBoxObject,
@ -68,10 +67,9 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSILISTBOXOBJECT
friend nsresult NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewListBoxBodyFrame(nsIPresShell* aPresShell,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
// nsIFrame
NS_IMETHOD Init(nsPresContext* aPresContext, nsIContent* aContent,

View File

@ -97,20 +97,9 @@ nsListItemFrame::GetFrameForPoint(const nsPoint& aPoint,
// Creation Routine ///////////////////////////////////////////////////////////////////////
nsresult
NS_NewListItemFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewListItemFrame(nsIPresShell* aPresShell, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsListItemFrame* it = new (aPresShell) nsListItemFrame(aPresShell, aIsRoot, aLayoutManager);
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsListItemFrame(aPresShell, aIsRoot, aLayoutManager);
} // NS_NewListItemFrame

View File

@ -40,20 +40,18 @@
#include "nsBoxFrame.h"
#include "nsGridRowLeafFrame.h"
nsresult NS_NewListItemFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
class nsListItemFrame : public nsGridRowLeafFrame
{
public:
NS_DECL_ISUPPORTS
friend nsresult NS_NewListItemFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
// overridden so that children of listitems don't handle mouse events,
// unless allowevents="true" is specified on the listitem

View File

@ -75,18 +75,10 @@
//
// Wrapper for creating a new menu Bar container
//
nsresult
NS_NewMenuBarFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMenuBarFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMenuBarFrame* it = new (aPresShell) nsMenuBarFrame (aPresShell);
if ( !it )
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMenuBarFrame (aPresShell);
}
NS_IMETHODIMP_(nsrefcnt)

View File

@ -57,7 +57,7 @@
class nsIContent;
class nsIMenuFrame;
nsresult NS_NewMenuBarFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewMenuBarFrame(nsIPresShell* aPresShell);
class nsMenuBarFrame : public nsBoxFrame, public nsIMenuParent
{

View File

@ -108,20 +108,15 @@ nsString *nsMenuFrame::gModifierSeparator = nsnull;
//
// Wrapper for creating a new menu popup container
//
nsresult
NS_NewMenuFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags)
nsIFrame*
NS_NewMenuFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMenuFrame* it = new (aPresShell) nsMenuFrame (aPresShell);
if ( !it )
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
if (aFlags)
if ((it != nsnull) && aFlags)
it->SetIsMenu(PR_TRUE);
return NS_OK;
return it;
}
NS_IMETHODIMP_(nsrefcnt)

View File

@ -58,7 +58,7 @@
#include "nsIContent.h"
#include "nsIScrollableViewProvider.h"
nsresult NS_NewMenuFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags) ;
nsIFrame* NS_NewMenuFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
class nsMenuBarFrame;
class nsMenuPopupFrame;

View File

@ -113,18 +113,10 @@ GetPopupSetFrame(nsPresContext* aPresContext)
//
// Wrapper for creating a new menu popup container
//
nsresult
NS_NewMenuPopupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewMenuPopupFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsMenuPopupFrame* it = new (aPresShell) nsMenuPopupFrame (aPresShell);
if ( !it )
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsMenuPopupFrame (aPresShell);
}
NS_IMETHODIMP_(nsrefcnt)

View File

@ -64,7 +64,7 @@
// need to find a good place to put them together.
// if someone changes one, please also change the other.
nsresult NS_NewMenuPopupFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewMenuPopupFrame(nsIPresShell* aPresShell) ;
class nsIViewManager;
class nsIView;

View File

@ -52,22 +52,12 @@
//
// NS_NewNativeScrollbarFrame
//
// Creates a new scrollbar frame and returns it in |aNewFrame|
// Creates a new scrollbar frame and returns it
//
nsresult
NS_NewNativeScrollbarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewNativeScrollbarFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsNativeScrollbarFrame* it = new (aPresShell) nsNativeScrollbarFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsNativeScrollbarFrame (aPresShell);
} // NS_NewNativeScrollbarFrame

View File

@ -56,7 +56,7 @@ class nsPresContext;
class nsIContent;
class nsStyleContext;
nsresult NS_NewNativeScrollbarFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewNativeScrollbarFrame(nsIPresShell* aPresShell);
class nsNativeScrollbarFrame : public nsBoxFrame

View File

@ -107,18 +107,10 @@ nsPopupFrameList* nsPopupFrameList::GetEntryByFrame(nsIFrame* aPopupFrame) {
//
// Wrapper for creating a new menu popup container
//
nsresult
NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewPopupSetFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsPopupSetFrame* it = new (aPresShell) nsPopupSetFrame (aPresShell);
if ( !it )
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsPopupSetFrame (aPresShell);
}
NS_IMETHODIMP_(nsrefcnt)

View File

@ -54,7 +54,7 @@
#include "nsITimer.h"
#include "nsISupportsArray.h"
nsresult NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell);
struct nsPopupFrameList {
nsPopupFrameList* mNextPopup; // The next popup in the list.

View File

@ -54,22 +54,12 @@
//
// NS_NewToolbarFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewProgressMeterFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewProgressMeterFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsProgressMeterFrame* it = new (aPresShell) nsProgressMeterFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsProgressMeterFrame(aPresShell);
} // NS_NewProgressMeterFrame
//

View File

@ -56,7 +56,7 @@ class nsPresContext;
class nsProgressMeterFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewProgressMeterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewProgressMeterFrame(nsIPresShell* aPresShell);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,

View File

@ -57,26 +57,15 @@
#include "nsGUIEvent.h"
//
// NS_NewXULButtonFrame
// NS_NewResizerFrame
//
// Creates a new Button frame and returns it in |aNewFrame|
// Creates a new Resizer frame and returns it
//
nsresult
NS_NewResizerFrame( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewResizerFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTitleBarFrame* it = new (aPresShell) nsResizerFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
// it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
} // NS_NewTitleBarFrame
return new (aPresShell) nsResizerFrame(aPresShell);
} // NS_NewResizerFrame
nsResizerFrame::nsResizerFrame(nsIPresShell* aPresShell)
:nsTitleBarFrame(aPresShell)

View File

@ -57,7 +57,7 @@ protected:
public:
friend nsresult NS_NewResizerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewResizerFrame(nsIPresShell* aPresShell);
nsResizerFrame(nsIPresShell* aPresShell);

View File

@ -67,7 +67,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
nsAutoRepeatBoxFrame(nsIPresShell* aPresShell);
friend nsresult NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
@ -81,20 +81,10 @@ protected:
PRPackedBool mTrustedEvent;
};
nsresult
NS_NewAutoRepeatBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewAutoRepeatBoxFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsAutoRepeatBoxFrame* it = new (aPresShell) nsAutoRepeatBoxFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsAutoRepeatBoxFrame (aPresShell);
} // NS_NewScrollBarButtonFrame

View File

@ -59,22 +59,12 @@
//
// NS_NewToolbarFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewScrollbarButtonFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewScrollbarButtonFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsScrollbarButtonFrame* it = new (aPresShell) nsScrollbarButtonFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsScrollbarButtonFrame (aPresShell);
} // NS_NewScrollBarButtonFrame

View File

@ -59,7 +59,7 @@ public:
// Overrides
NS_IMETHOD Destroy(nsPresContext* aPresContext);
friend nsresult NS_NewScrollBarButtonFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewScrollBarButtonFrame(nsIPresShell* aPresShell);
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
nsGUIEvent* aEvent,

View File

@ -53,22 +53,12 @@
//
// NS_NewToolbarFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewScrollbarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewScrollbarFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsScrollbarFrame* it = new (aPresShell) nsScrollbarFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsScrollbarFrame (aPresShell);
} // NS_NewScrollbarFrame
//

View File

@ -49,7 +49,7 @@
class nsISupportsArray;
class nsIScrollbarMediator;
nsresult NS_NewScrollbarFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewScrollbarFrame(nsIPresShell* aPresShell);
class nsScrollbarFrame : public nsBoxFrame, public nsIScrollbarFrame
{

View File

@ -92,20 +92,10 @@ GetContentOfBox(nsIBox *aBox)
return content;
}
nsresult
NS_NewSliderFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewSliderFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSliderFrame* it = new (aPresShell) nsSliderFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSliderFrame(aPresShell);
} // NS_NewSliderFrame
nsSliderFrame::nsSliderFrame(nsIPresShell* aPresShell):nsBoxFrame(aPresShell),

View File

@ -52,7 +52,7 @@ class nsISupportsArray;
class nsITimer;
class nsSliderFrame;
nsresult NS_NewSliderFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewSliderFrame(nsIPresShell* aPresShell);
class nsSliderMediator : public nsIDOMMouseListener,

View File

@ -225,22 +225,12 @@ nsSplitterFrameInner::GetState()
//
// NS_NewSplitterFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewSplitterFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewSplitterFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsSplitterFrame* it = new (aPresShell) nsSplitterFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsSplitterFrame(aPresShell);
} // NS_NewSplitterFrame
nsSplitterFrame::nsSplitterFrame(nsIPresShell* aPresShell)

View File

@ -48,7 +48,7 @@
class nsISupportsArray;
class nsSplitterFrameInner;
nsresult NS_NewSplitterFrame(nsIPresShell* aPresShell, nsIFrame** aResult) ;
nsIFrame* NS_NewSplitterFrame(nsIPresShell* aPresShell);
class nsSplitterFrame : public nsBoxFrame
{

View File

@ -58,21 +58,10 @@
#include "nsBoxLayoutState.h"
#include "nsStackLayout.h"
nsresult
NS_NewStackFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayoutManager)
nsIFrame*
NS_NewStackFrame ( nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsStackFrame* it = new (aPresShell) nsStackFrame(aPresShell, aLayoutManager);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsStackFrame(aPresShell, aLayoutManager);
} // NS_NewStackFrame
nsStackFrame::nsStackFrame(nsIPresShell* aPresShell, nsIBoxLayout* aLayoutManager):nsBoxFrame(aPresShell)

View File

@ -52,7 +52,7 @@ class nsStackFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewStackFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, nsIBoxLayout* aLayout = nsnull);
friend nsIFrame* NS_NewStackFrame(nsIPresShell* aPresShell, nsIBoxLayout* aLayout = nsnull);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const

View File

@ -101,23 +101,12 @@ PRBool nsTextBoxFrame::gInsertSeparatorPrefInitialized = PR_FALSE;
//
// NS_NewToolbarFrame
//
// Creates a new Toolbar frame and returns it in |aNewFrame|
// Creates a new Toolbar frame and returns it
//
nsresult
NS_NewTextBoxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewTextBoxFrame (nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTextBoxFrame* it = new (aPresShell) nsTextBoxFrame (aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
// it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsTextBoxFrame (aPresShell);
} // NS_NewTextFrame

View File

@ -56,7 +56,7 @@ public:
enum CroppingStyle { CropNone, CropLeft, CropRight, CropCenter };
friend nsresult NS_NewTextBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewTextBoxFrame(nsIPresShell* aPresShell);
NS_IMETHOD Init(nsPresContext* aPresContext,
nsIContent* aContent,

View File

@ -53,23 +53,12 @@
//
// NS_NewTitleBarFrame
//
// Creates a new TitleBar frame and returns it in |aNewFrame|
// Creates a new TitleBar frame and returns it
//
nsresult
NS_NewTitleBarFrame( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
nsIFrame*
NS_NewTitleBarFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTitleBarFrame* it = new (aPresShell) nsTitleBarFrame(aPresShell);
if (nsnull == it)
return NS_ERROR_OUT_OF_MEMORY;
// it->SetFlags(aFlags);
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsTitleBarFrame(aPresShell);
} // NS_NewTitleBarFrame
nsTitleBarFrame::nsTitleBarFrame(nsIPresShell* aPresShell)

View File

@ -44,7 +44,7 @@ class nsTitleBarFrame : public nsBoxFrame
{
public:
friend nsresult NS_NewTitleBarFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
friend nsIFrame* NS_NewTitleBarFrame(nsIPresShell* aPresShell);
nsTitleBarFrame(nsIPresShell* aPresShell);

View File

@ -128,20 +128,10 @@ CancelImageRequest(nsHashKey* aKey, void* aData, void* aClosure)
//
// Creates a new tree frame
//
nsresult
NS_NewTreeBodyFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
nsIFrame*
NS_NewTreeBodyFrame(nsIPresShell* aPresShell)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTreeBodyFrame* it = new (aPresShell) nsTreeBodyFrame(aPresShell);
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsTreeBodyFrame(aPresShell);
} // NS_NewTreeFrame

View File

@ -194,8 +194,7 @@ public:
const nsRect& aRect,
const nsRect& aDirtyRect);
friend nsresult NS_NewTreeBodyFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame);
friend nsIFrame* NS_NewTreeBodyFrame(nsIPresShell* aPresShell);
protected:
PRInt32 GetLastVisibleRow() {

View File

@ -55,21 +55,11 @@
//
// Creates a new col frame
//
nsresult
NS_NewTreeColFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot,
nsIFrame*
NS_NewTreeColFrame(nsIPresShell* aPresShell, PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
return NS_ERROR_NULL_POINTER;
}
nsTreeColFrame* it = new (aPresShell) nsTreeColFrame(aPresShell, aIsRoot, aLayoutManager);
if (!it)
return NS_ERROR_OUT_OF_MEMORY;
*aNewFrame = it;
return NS_OK;
return new (aPresShell) nsTreeColFrame(aPresShell, aIsRoot, aLayoutManager);
} // NS_NewTreeColFrame
NS_IMETHODIMP_(nsrefcnt)

View File

@ -39,10 +39,9 @@
#include "nsBoxFrame.h"
#include "nsITreeColumns.h"
nsresult NS_NewTreeColFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
PRBool aIsRoot = PR_FALSE,
nsIBoxLayout* aLayoutManager = nsnull);
class nsTreeColFrame : public nsBoxFrame
{
@ -68,10 +67,9 @@ public:
NS_IMETHOD SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
PRBool aRemoveOverflowArea = PR_FALSE);
friend nsresult NS_NewTreeColFrame(nsIPresShell* aPresShell,
nsIFrame** aNewFrame,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
protected:
nsTreeColFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);