Bug 276079 - fix couple coding style in IsJustifiableCharacter. draft
authorjeremychen@mozilla.com <jeremychen@mozilla.com>
Wed, 01 Mar 2017 20:58:25 +0800
changeset 490896 c0c46c4e46220cda55fe87d02db7bb1871b184c9
parent 490895 bc70cdf265bad5b003bb0a6279e6a4147a6e675b
child 490897 4e54885fdf5263dd138757630b9216c035c71edf
push id47261
push userjichen@mozilla.com
push dateWed, 01 Mar 2017 12:59:44 +0000
bugs276079
milestone54.0a1
Bug 276079 - fix couple coding style in IsJustifiableCharacter. 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,