Bug 1453456 - Remove nsCRT::IsAscii(char16_t) in favor of mozilla::IsAscii. r=froydnj

This commit is contained in:
Jeff Walden 2019-02-25 12:21:15 -08:00
Родитель 8911c5eb8d
Коммит a25f0304c2
3 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -20,6 +20,8 @@
# include "prinrval.h"
#endif
using mozilla::IsAscii;
const double growthRate = 1.2;
// Bug 183111, editor now replaces multiple spaces with leading
@ -214,7 +216,7 @@ bool mozTXTToHTMLConv::FindURLStart(const char16_t* aInString,
aInString[uint32_t(i)] != '[' && aInString[uint32_t(i)] != '(' &&
aInString[uint32_t(i)] != '|' && aInString[uint32_t(i)] != '\\' &&
!IsSpace(aInString[uint32_t(i)]) &&
(!isEmail || nsCRT::IsAscii(aInString[uint32_t(i)])) &&
(!isEmail || IsAscii(aInString[uint32_t(i)])) &&
(!isEmail || aInString[uint32_t(i)] != ')');
i--)
;
@ -270,7 +272,7 @@ bool mozTXTToHTMLConv::FindURLEnd(const char16_t* aInString,
// Disallow non-ascii-characters for email.
// Currently correct, but revisit later after standards changed.
if (isEmail && (aInString[i] == '(' || aInString[i] == '\'' ||
!nsCRT::IsAscii(aInString[i])))
!IsAscii(aInString[i])))
break;
if (aInString[i] == '(') seenOpeningParenthesis = true;
if (aInString[i] == '[') seenOpeningSquareBracket = true;

Просмотреть файл

@ -93,8 +93,6 @@ inline char NS_ToLower(char aChar) {
bool NS_IsUpper(char aChar);
bool NS_IsLower(char aChar);
constexpr bool NS_IsAscii(char16_t aChar) { return (0x0080 > aChar); }
constexpr bool NS_IsAscii(const char16_t* aString) {
while (*aString) {
if (0x0080 <= *aString) {

Просмотреть файл

@ -89,7 +89,6 @@ class nsCRT {
static bool IsUpper(char aChar) { return NS_IsUpper(aChar); }
static bool IsLower(char aChar) { return NS_IsLower(aChar); }
static bool IsAscii(char16_t aChar) { return NS_IsAscii(aChar); }
static bool IsAscii(const char16_t* aString) { return NS_IsAscii(aString); }
static bool IsAsciiSpace(char16_t aChar) {
return NS_IsAsciiWhitespace(aChar);