summaryrefslogtreecommitdiff
path: root/fpdfsdk/cfx_systemhandler.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 /fpdfsdk/cfx_systemhandler.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 'fpdfsdk/cfx_systemhandler.cpp')
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index 28170d2878..62d7c735b0 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -20,22 +20,6 @@
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
-namespace {
-
-int CharSet2CP(int charset) {
- if (charset == FX_CHARSET_ShiftJIS)
- return FX_CODEPAGE_ShiftJIS;
- if (charset == FX_CHARSET_ChineseSimplified)
- return FX_CODEPAGE_ChineseSimplified;
- if (charset == FX_CHARSET_Hangul)
- return FX_CODEPAGE_Hangul;
- if (charset == FX_CHARSET_ChineseTraditional)
- return FX_CODEPAGE_ChineseTraditional;
- return FX_CODEPAGE_DefANSI;
-}
-
-} // namespace
-
CFX_SystemHandler::CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv) {}
@@ -121,7 +105,8 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(
return nullptr;
auto pFXFont = pdfium::MakeUnique<CFX_Font>();
- pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0, CharSet2CP(nCharset), false);
+ pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0,
+ FX_GetCodePageFromCharset(nCharset), false);
return pDoc->AddFont(pFXFont.get(), nCharset, false);
}