Bug 276079 - fix couple coding style in IsJustifiableCharacter. r=xidorn
authorjeremychen@mozilla.com <jeremychen@mozilla.com>
Wed, 01 Mar 2017 20:58:25 +0800
changeset 392043 17c186ca2567b016aed72bd13ffa68fb894d3725
parent 392042 fb76940bbff6becfaabf1690e263be02ad7a7655
child 392044 534299ae8575d7ad416c2ec8c4d5fb13ee0e221e
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs276079
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 276079 - fix couple coding style in IsJustifiableCharacter. r=xidorn MozReview-Commit-ID: Hf13sGzwdDl
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -2964,27 +2964,30 @@ nsTextFrame::GetTrimmedOffsets(const nsT
   return offsets;
 }
 
 static bool IsJustifiableCharacter(const nsTextFragment* aFrag, int32_t aPos,
                                    bool aLangIsCJ)
 {
   NS_ASSERTION(aPos >= 0, "negative position?!");
   char16_t ch = aFrag->CharAt(aPos);
-  if (ch == '\n' || ch == '\t' || ch == '\r')
+  if (ch == '\n' || ch == '\t' || ch == '\r') {
     return true;
+  }
   if (ch == ' ' || ch == CH_NBSP) {
     // Don't justify spaces that are combined with diacriticals
-    if (!aFrag->Is2b())
+    if (!aFrag->Is2b()) {
       return true;
+    }
     return !nsTextFrameUtils::IsSpaceCombiningSequenceTail(
-        aFrag->Get2b() + aPos + 1, aFrag->GetLength() - (aPos + 1));
-  }
-  if (ch < 0x2150u)
+      aFrag->Get2b() + aPos + 1, aFrag->GetLength() - (aPos + 1));
+  }
+  if (ch < 0x2150u) {
     return false;
+  }
   if (aLangIsCJ) {
     if ((0x2150u <= ch && ch <= 0x22ffu) || // Number Forms, Arrows, Mathematical Operators
         (0x2460u <= ch && ch <= 0x24ffu) || // Enclosed Alphanumerics
         (0x2580u <= ch && ch <= 0x27bfu) || // Block Elements, Geometric Shapes, Miscellaneous Symbols, Dingbats
         (0x27f0u <= ch && ch <= 0x2bffu) || // Supplemental Arrows-A, Braille Patterns, Supplemental Arrows-B,
                                             // Miscellaneous Mathematical Symbols-B, Supplemental Mathematical Operators,
                                             // Miscellaneous Symbols and Arrows
         (0x2e80u <= ch && ch <= 0x312fu) || // CJK Radicals Supplement, CJK Radicals Supplement,