Bug 1080621 - Don't pass nscoord in-params by reference in nsBidiPresUtils methods. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Thu, 16 Oct 2014 09:40:20 +0100
changeset 210692 57ba7ce96c4a340a5a5598a0ce3bc332f0176b5a
parent 210691 1abddb50ed3450a4406ce409697734b3b05928fd
child 210693 0a7825c642ffb0c799a6ceb9d11fcbb7e5c74f8d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmontagu
bugs1080621
milestone36.0a1
Bug 1080621 - Don't pass nscoord in-params by reference in nsBidiPresUtils methods. r=smontagu
layout/base/nsBidiPresUtils.cpp
layout/base/nsBidiPresUtils.h
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -1219,17 +1219,17 @@ nsBidiPresUtils::ResolveParagraphWithinB
   ResolveParagraph(aBlockFrame, aBpd);
   aBpd->ResetData();
 }
 
 void
 nsBidiPresUtils::ReorderFrames(nsIFrame*   aFirstFrameOnLine,
                                int32_t     aNumFramesOnLine,
                                WritingMode aLineWM,
-                               nscoord&    aLineWidth,
+                               nscoord     aLineWidth,
                                nscoord     aStart)
 {
   // If this line consists of a line frame, reorder the line frame's children.
   if (aFirstFrameOnLine->GetType() == nsGkAtoms::lineFrame) {
     aFirstFrameOnLine = aFirstFrameOnLine->GetFirstPrincipalChild();
     if (!aFirstFrameOnLine)
       return;
     // All children of the line frame are on the first line. Setting aNumFramesOnLine
@@ -1394,17 +1394,17 @@ nsBidiPresUtils::IsFirstOrLast(nsIFrame*
 }
 
 void
 nsBidiPresUtils::RepositionFrame(nsIFrame*             aFrame,
                                  bool                  aIsEvenLevel,
                                  nscoord&              aStart,
                                  nsContinuationStates* aContinuationStates,
                                  WritingMode           aContainerWM,
-                                 nscoord&              aContainerWidth)
+                                 nscoord               aContainerWidth)
 {
   if (!aFrame)
     return;
 
   bool isFirst, isLast;
   WritingMode frameWM = aFrame->GetWritingMode();
   IsFirstOrLast(aFrame,
                 aContinuationStates,
@@ -1504,18 +1504,18 @@ nsBidiPresUtils::InitContinuationStates(
     }
   }
 }
 
 void
 nsBidiPresUtils::RepositionInlineFrames(BidiLineData *aBld,
                                         nsIFrame* aFirstChild,
                                         WritingMode aLineWM,
-                                        nscoord& aLineWidth,
-                                        nscoord& aStart)
+                                        nscoord aLineWidth,
+                                        nscoord aStart)
 {
   nscoord start = aStart;
   nsIFrame* frame;
   int32_t count = aBld->mVisualFrames.Length();
   int32_t index;
   nsContinuationStates continuationStates;
 
   // Initialize continuation states to (nullptr, 0) for
--- a/layout/base/nsBidiPresUtils.h
+++ b/layout/base/nsBidiPresUtils.h
@@ -155,17 +155,17 @@ public:
    * Reorder this line using Bidi engine.
    * Update frame array, following the new visual sequence.
    * 
    * @lina 05/02/2000
    */
   static void ReorderFrames(nsIFrame*            aFirstFrameOnLine,
                             int32_t              aNumFramesOnLine,
                             mozilla::WritingMode aLineWM,
-                            nscoord&             aLineWidth,
+                            nscoord              aLineWidth,
                             nscoord              aStart);
 
   /**
    * Format Unicode text, taking into account bidi capabilities
    * of the platform. The formatting includes: reordering, Arabic shaping,
    * symmetric and numeric swapping, removing control characters.
    *
    * @lina 06/18/2000 
@@ -394,17 +394,17 @@ private:
    *                             (after adding its inline-end margin)
    * @param aContinuationStates  A map from nsIFrame* to nsFrameContinuationState
    */
   static void RepositionFrame(nsIFrame*              aFrame,
                               bool                   aIsEvenLevel,
                               nscoord&               aStart,
                               nsContinuationStates*  aContinuationStates,
                               mozilla::WritingMode   aContainerWM,
-                              nscoord&               aContainerWidth);
+                              nscoord                aContainerWidth);
 
   /*
    * Initialize the continuation state(nsFrameContinuationState) to
    * (nullptr, 0) for aFrame and its descendants.
    *
    * @param aFrame               The frame which itself and its descendants will
    *                             be initialized
    * @param aContinuationStates  A map from nsIFrame* to nsFrameContinuationState
@@ -447,18 +447,18 @@ private:
    *
    *  @param aFirstChild the first kid
    *
    *  @lina 04/11/2000
    */
   static void RepositionInlineFrames(BidiLineData* aBld,
                                      nsIFrame* aFirstChild,
                                      mozilla::WritingMode aLineWM,
-                                     nscoord& aLineWidth,
-                                     nscoord& aStart);
+                                     nscoord aLineWidth,
+                                     nscoord aStart);
   
   /**
    * Helper method for Resolve()
    * Truncate a text frame to the end of a single-directional run and possibly
    * create a continuation frame for the remainder of its content.
    *
    * @param aFrame       the original frame
    * @param aNewFrame    [OUT] the new frame that was created