Bug 1307402 - reformat if-else-statements in nsFirstLetterFrame.cpp to agree with mozilla coding style. draft
authorJeremy Chen <jeremychen@mozilla.com>
Tue, 04 Oct 2016 22:22:52 +0800
changeset 420745 2fe66194041f4c964707d1bffa0d40fcfb56787d
parent 420680 42c95d88aaaa7c2eca1d278399421d437441ac4d
child 420746 a7df6e685f03df0c6a65218c2c9325b6b9abeb72
push id31274
push userjichen@mozilla.com
push dateTue, 04 Oct 2016 14:27:11 +0000
bugs1307402
milestone52.0a1
Bug 1307402 - reformat if-else-statements in nsFirstLetterFrame.cpp to agree with mozilla coding style. MozReview-Commit-ID: L9V1cEkmtkF
layout/generic/nsFirstLetterFrame.cpp
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -96,22 +96,21 @@ nsFirstLetterFrame::SetInitialChildList(
 
 nsresult
 nsFirstLetterFrame::GetChildFrameContainingOffset(int32_t inContentOffset,
                                                   bool inHint,
                                                   int32_t* outFrameContentOffset,
                                                   nsIFrame **outChildFrame)
 {
   nsIFrame *kid = mFrames.FirstChild();
-  if (kid)
-  {
+  if (kid) {
     return kid->GetChildFrameContainingOffset(inContentOffset, inHint, outFrameContentOffset, outChildFrame);
+  } else {
+    return nsFrame::GetChildFrameContainingOffset(inContentOffset, inHint, outFrameContentOffset, outChildFrame);
   }
-  else
-    return nsFrame::GetChildFrameContainingOffset(inContentOffset, inHint, outFrameContentOffset, outChildFrame);
 }
 
 // Needed for non-floating first-letter frames and for the continuations
 // following the first-letter that we also use nsFirstLetterFrame for.
 /* virtual */ void
 nsFirstLetterFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                       nsIFrame::InlineMinISizeData *aData)
 {
@@ -235,18 +234,17 @@ nsFirstLetterFrame::Reflow(nsPresContext
     // Ensure that the overflow rect contains the child textframe's
     // overflow rect.
     // Note that if this is floating, the overline/underline drawable
     // area is in the overflow rect of the child textframe.
     aMetrics.UnionOverflowAreasWithDesiredBounds();
     ConsiderChildOverflow(aMetrics.mOverflowAreas, kid);
 
     FinishAndStoreOverflow(&aMetrics);
-  }
-  else {
+  } else {
     // Pretend we are a span and reflow the child frame
     nsLineLayout* ll = aReflowInput.mLineLayout;
     bool          pushedFrame;
 
     ll->SetInFirstLetter(
       mStyleContext->GetPseudo() == nsCSSPseudoElements::firstLetter);
     ll->BeginSpan(this, &aReflowInput, bp.IStart(wm),
                   availSize.ISize(wm), &mBaseline);
@@ -268,18 +266,17 @@ nsFirstLetterFrame::Reflow(nsPresContext
       if (aReflowInput.mLineLayout) {
         aReflowInput.mLineLayout->SetFirstLetterStyleOK(false);
       }
       nsIFrame* kidNextInFlow = kid->GetNextInFlow();
       if (kidNextInFlow) {
         // Remove all of the childs next-in-flows
         kidNextInFlow->GetParent()->DeleteNextInFlowChild(kidNextInFlow, true);
       }
-    }
-    else {
+    } else {
       // Create a continuation for the child frame if it doesn't already
       // have one.
       if (!IsFloating()) {
         CreateNextInFlow(kid);
         // And then push it to our overflow list
         const nsFrameList& overflow = mFrames.RemoveFramesAfter(kid);
         if (overflow.NotEmpty()) {
           SetOverflowFrames(overflow);