From 5187549cd195bdb6bd21f7c97dca41fdeac0ae21 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Wed, 26 Oct 2016 18:49:07 +0200 Subject: [PATCH] Backed out changeset fd1d01c7a9e2 (bug 1081858) for failing reftest segment-break-transformation-1.html on Windows XP. r=backout --- layout/generic/nsTextFrameUtils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/layout/generic/nsTextFrameUtils.cpp b/layout/generic/nsTextFrameUtils.cpp index dc5f32e211a0..d1eedd48abb6 100644 --- a/layout/generic/nsTextFrameUtils.cpp +++ b/layout/generic/nsTextFrameUtils.cpp @@ -51,7 +51,7 @@ nsTextFrameUtils::TransformText(const char16_t* aText, uint32_t aLength, // Skip discardables. uint32_t i; for (i = 0; i < aLength; ++i) { - char16_t ch = aText[i]; + char16_t ch = *aText++; if (IsDiscardable(ch, &flags)) { aSkipChars->SkipChar(); } else { @@ -82,15 +82,15 @@ nsTextFrameUtils::TransformText(const char16_t* aText, uint32_t aLength, bool inWhitespace = (*aIncomingFlags & INCOMING_WHITESPACE) != 0; uint32_t i; for (i = 0; i < aLength; ++i) { - char16_t ch = aText[i]; + char16_t ch = *aText++; bool nowInWhitespace; if (ch == ' ' && (i + 1 >= aLength || - !IsSpaceCombiningSequenceTail(&aText[i + 1], aLength - (i + 1)))) { + !IsSpaceCombiningSequenceTail(aText, aLength - (i + 1)))) { nowInWhitespace = true; } else if (ch == '\n' && aCompression == COMPRESS_WHITESPACE_NEWLINE) { - if (i > 0 && IS_CJ_CHAR(aText[i - 1]) && - i + 1 < aLength && IS_CJ_CHAR(aText[i + 1])) { + if (i > 0 && IS_CJ_CHAR(aText[-1]) && + i + 1 < aLength && IS_CJ_CHAR(aText[1])) { // Discard newlines between CJK chars. // XXX this really requires more context to get right! aSkipChars->SkipChar(); @@ -158,7 +158,7 @@ nsTextFrameUtils::TransformText(const uint8_t* aText, uint32_t aLength, // Skip discardables. uint32_t i; for (i = 0; i < aLength; ++i) { - uint8_t ch = aText[i]; + uint8_t ch = *aText++; if (IsDiscardable(ch, &flags)) { aSkipChars->SkipChar(); } else { @@ -182,7 +182,7 @@ nsTextFrameUtils::TransformText(const uint8_t* aText, uint32_t aLength, bool inWhitespace = (*aIncomingFlags & INCOMING_WHITESPACE) != 0; uint32_t i; for (i = 0; i < aLength; ++i) { - uint8_t ch = aText[i]; + uint8_t ch = *aText++; bool nowInWhitespace = ch == ' ' || ch == '\t' || (ch == '\n' && aCompression == COMPRESS_WHITESPACE_NEWLINE); if (!nowInWhitespace) {