summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-17 15:38:19 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 17:17:36 +0000
commit3c3e271ea9fd19dd535a74b5546b27e3e82dcb81 (patch)
treee73049f2d18718da9ff8d42b46f31009c5e6e887 /core/fxge
parent94c5e25840046b7bf976d2d568e19ad63b656ade (diff)
downloadpdfium-3c3e271ea9fd19dd535a74b5546b27e3e82dcb81.tar.xz
Use Byte/WideString iterators
Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b Reviewed-on: https://pdfium-review.googlesource.com/4262 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp
index 0cff344599..ff80685d96 100644
--- a/core/fxge/ge/cfx_fontmapper.cpp
+++ b/core/fxge/ge/cfx_fontmapper.cpp
@@ -6,6 +6,7 @@
#include "core/fxge/cfx_fontmapper.h"
+#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
@@ -326,14 +327,9 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) {
if (name == m_LastFamily)
return;
- const uint8_t* ptr = name.raw_str();
- bool bLocalized = false;
- for (int i = 0; i < name.GetLength(); i++) {
- if (ptr[i] > 0x80) {
- bLocalized = true;
- break;
- }
- }
+ bool bLocalized = std::any_of(name.begin(), name.end(), [](const char& c) {
+ return static_cast<uint8_t>(c) > 0x80;
+ });
if (bLocalized) {
void* hFont = m_pFontInfo->GetFont(name.c_str());