summaryrefslogtreecommitdiff
path: root/fpdfsdk/cfx_systemhandler.cpp
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-10-06 12:29:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-06 12:29:09 -0700
commit065c35006d96eaca324f49248d20d83709a25fbe (patch)
tree46d3d235bc8a8192748fa64166cb3d86aa65a0d8 /fpdfsdk/cfx_systemhandler.cpp
parentaa6e8b555e113a3f91a49258ed83810abf0d4929 (diff)
downloadpdfium-065c35006d96eaca324f49248d20d83709a25fbe.tar.xz
Split m_InstalledTTFonts into two vectors to avoid sketchy logic.
Instead of relying on ' ' to determine whether the CFX_Bytestring is added on one place or another, use another vector. When trying to match fonts from the fontmapper, compare with both vectors. BUG=pdfium:510 Review-Url: https://codereview.chromium.org/2395883002
Diffstat (limited to 'fpdfsdk/cfx_systemhandler.cpp')
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index bfa80df126..72cb9f57ed 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -106,6 +106,10 @@ bool CFX_SystemHandler::FindNativeTrueTypeFont(CFX_ByteString sFontFaceName) {
if (font.Compare(sFontFaceName.AsStringC()))
return true;
}
+ for (const auto& fontPair : pFontMapper->m_LocalizedTTFonts) {
+ if (fontPair.first.Compare(sFontFaceName.AsStringC()))
+ return true;
+ }
return false;
}