summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdftext/cpdf_textpage.cpp2
-rw-r--r--core/fxcrt/css/cfx_cssselector.cpp2
-rw-r--r--core/fxcrt/css/cfx_csssyntaxparser.cpp3
-rw-r--r--core/fxcrt/fx_extension.h4
4 files changed, 6 insertions, 5 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 7541dae6a7..e712549ceb 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -1210,7 +1210,7 @@ bool CPDF_TextPage::IsHyphen(wchar_t curChar) const {
if ((iter + 1) != curText.rend()) {
iter++;
- if (FXSYS_iswASCIIalpha(*iter) && FXSYS_iswalnum(curChar))
+ if (FXSYS_iswalpha(*iter) && FXSYS_iswalnum(curChar))
return true;
}
diff --git a/core/fxcrt/css/cfx_cssselector.cpp b/core/fxcrt/css/cfx_cssselector.cpp
index 8a22b12287..510114f2e5 100644
--- a/core/fxcrt/css/cfx_cssselector.cpp
+++ b/core/fxcrt/css/cfx_cssselector.cpp
@@ -67,7 +67,7 @@ std::unique_ptr<CFX_CSSSelector> CFX_CSSSelector::FromString(
std::unique_ptr<CFX_CSSSelector> pFirst = nullptr;
for (psz = pStart; psz < pEnd;) {
wchar_t wch = *psz;
- if (FXSYS_iswASCIIalpha(wch) || wch == '*') {
+ if ((isascii(wch) && isalpha(wch)) || wch == '*') {
int32_t iNameLen = wch == '*' ? 1 : GetCSSNameLen(psz, pEnd);
auto p = pdfium::MakeUnique<CFX_CSSSelector>(CFX_CSSSelectorType::Element,
psz, iNameLen, true);
diff --git a/core/fxcrt/css/cfx_csssyntaxparser.cpp b/core/fxcrt/css/cfx_csssyntaxparser.cpp
index fea951f1ec..97586dc59f 100644
--- a/core/fxcrt/css/cfx_csssyntaxparser.cpp
+++ b/core/fxcrt/css/cfx_csssyntaxparser.cpp
@@ -18,7 +18,8 @@
namespace {
bool IsSelectorStart(wchar_t wch) {
- return wch == '.' || wch == '#' || wch == '*' || FXSYS_iswASCIIalpha(wch);
+ return wch == '.' || wch == '#' || wch == '*' ||
+ (isascii(wch) && isalpha(wch));
}
} // namespace
diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h
index bd0ac8b303..fd7b78afdb 100644
--- a/core/fxcrt/fx_extension.h
+++ b/core/fxcrt/fx_extension.h
@@ -42,8 +42,8 @@ inline int32_t FXSYS_toASCIIupper(int32_t ch) {
return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
}
-inline bool FXSYS_iswASCIIalpha(wchar_t wch) {
- return FXSYS_isASCIIupper(wch) || FXSYS_isASCIIlower(wch);
+inline bool FXSYS_iswalpha(wchar_t c) {
+ return u_isalpha(c);
}
inline bool FXSYS_iswalnum(wchar_t c) {