From a91a28273f4bbe3a24c4a2189be7e9f072a3a6ed Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Sat, 27 Aug 2005 18:30:36 +0000 Subject: [PATCH] code share GetCaptionAdjustedParent between AdjustCaptionParentFrame, bug 289936 r/sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@179139 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 76b07c8d920..381e9233b5c 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1802,28 +1802,6 @@ nsAutoEnqueueBinding::~nsAutoEnqueueBinding() } } -/** - * If the parent frame is a |tableFrame| and the child is a - * |captionFrame|, then we want to insert the frames beneath the - * |tableFrame|'s parent frame. Returns |PR_TRUE| if the parent frame - * needed to be fixed up. - */ -static PRBool -GetCaptionAdjustedParent(nsIFrame* aParentFrame, - const nsIFrame* aChildFrame, - nsIFrame** aAdjParentFrame) -{ - *aAdjParentFrame = aParentFrame; - PRBool haveCaption = PR_FALSE; - - if (nsLayoutAtoms::tableCaptionFrame == aChildFrame->GetType()) { - haveCaption = PR_TRUE; - if (nsLayoutAtoms::tableFrame == aParentFrame->GetType()) { - *aAdjParentFrame = aParentFrame->GetParent(); - } - } - return haveCaption; -} // Helper function that determines the child list name that aChildFrame // is contained in @@ -2430,7 +2408,28 @@ AdjustCaptionParentFrame(nsIFrame* aParentFrame) } return aParentFrame; } - + +/** + * If the parent frame is a |tableFrame| and the child is a + * |captionFrame|, then we want to insert the frames beneath the + * |tableFrame|'s parent frame. Returns |PR_TRUE| if the parent frame + * needed to be fixed up. + */ +static PRBool +GetCaptionAdjustedParent(nsIFrame* aParentFrame, + const nsIFrame* aChildFrame, + nsIFrame** aAdjParentFrame) +{ + *aAdjParentFrame = aParentFrame; + PRBool haveCaption = PR_FALSE; + + if (nsLayoutAtoms::tableCaptionFrame == aChildFrame->GetType()) { + haveCaption = PR_TRUE; + *aAdjParentFrame = AdjustCaptionParentFrame(aParentFrame); + } + return haveCaption; +} + static nsresult ProcessPseudoFrame(nsPresContext* aPresContext, nsPseudoFrameData& aPseudoData,