summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.cpp
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2018-05-31 14:08:11 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-31 14:08:11 +0000
commit656eb84f83fc1701737d9c65658371a99428d727 (patch)
tree6fb28e4283c1ef8696b42d8b7d200a13c32742fc /core/fpdfapi/parser/cpdf_document.cpp
parent8f7ee98e2c622c21f452cd9fd5956fe85bcb2b7c (diff)
downloadpdfium-656eb84f83fc1701737d9c65658371a99428d727.tar.xz
Move codepage/charset methods into related places.
Change-Id: I71417cc5b1bd00f77d42740198cc17487ebd686e Reviewed-on: https://pdfium-review.googlesource.com/33330 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 2e4baabe91..412f726eca 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -736,9 +736,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) {
if (!pFont)
return nullptr;
- bool bCJK = charset == FX_CHARSET_ChineseTraditional ||
- charset == FX_CHARSET_ChineseSimplified ||
- charset == FX_CHARSET_Hangul || charset == FX_CHARSET_ShiftJIS;
+ const bool bCJK = FX_CharSetIsCJK(charset);
ByteString basefont = pFont->GetFamilyName();
basefont.Replace(" ", "");
int flags =
@@ -856,10 +854,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont,
(pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT,
pLogFont->lfCharSet == FX_CHARSET_Symbol);
- bool bCJK = pLogFont->lfCharSet == FX_CHARSET_ChineseTraditional ||
- pLogFont->lfCharSet == FX_CHARSET_ChineseSimplified ||
- pLogFont->lfCharSet == FX_CHARSET_Hangul ||
- pLogFont->lfCharSet == FX_CHARSET_ShiftJIS;
+ const bool bCJK = FX_CharSetIsCJK(pLogFont->lfCharSet);
ByteString basefont;
if (bTranslateName && bCJK)
basefont = FPDF_GetPSNameFromTT(hDC);