Bug 964078. r=roc, a=bajaj
authorMats Palmgren <matspal@gmail.com>
Tue, 28 Jan 2014 09:15:24 -0500
changeset 176095 41a58e12473fa62fc0346c4784460142bf451e7f
parent 176094 5b9c5ed94b04258f1be088609c144abb5e5826ba
child 176096 bdce57ad9ec4ec3b5e1aaf9ca628950fb8680b52
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, bajaj
bugs964078
milestone28.0a2
Bug 964078. r=roc, a=bajaj
layout/generic/nsBulletFrame.cpp
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* rendering object for list-item bullets */
 
 #include "nsBulletFrame.h"
 
+#include "mozilla/MathAlgorithms.h"
 #include "nsCOMPtr.h"
 #include "nsGkAtoms.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsRenderingContext.h"
@@ -892,28 +893,26 @@ static const CJKIdeographicData gDataTra
     0x4f0d, 0x9678, 0x67d2, 0x634c, 0x7396
   },
   { 0x62fe, 0x4f70, 0x4edf }, // unit
   { 0x842c, 0x5104 },         // unit10K
   CHINESE,                    // lang
   false                       // informal
 };
 
-static const bool CJKIdeographicToText(int32_t ordinal, nsString& result,
+static const bool CJKIdeographicToText(int32_t aOrdinal, nsString& result,
                                        const CJKIdeographicData& data)
 {
   PRUnichar buf[NUM_BUF_SIZE];
   int32_t idx = NUM_BUF_SIZE;
   int32_t pos = 0;
-  bool isNegative = (ordinal < 0);
-  bool needZero = (ordinal == 0);
+  bool isNegative = (aOrdinal < 0);
+  bool needZero = (aOrdinal == 0);
   int32_t unitidx = 0, unit10Kidx = 0;
-  if (isNegative) {
-    ordinal = -ordinal;
-  }
+  uint32_t ordinal = mozilla::Abs(aOrdinal);
   do {
     unitidx = pos % 4;
     if (unitidx == 0) {
       unit10Kidx = pos / 4;
     }
     int32_t cur = ordinal % 10;
     if (cur == 0) {
       if (needZero) {