summaryrefslogtreecommitdiff
path: root/fpdfsdk/cfx_systemhandler.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-19 12:46:53 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-19 17:08:38 +0000
commitf51a02a29e10fcc490ba28f44d43f50104f940ed (patch)
tree354215ff5deeea419ce5a88b369535b5e4468a62 /fpdfsdk/cfx_systemhandler.cpp
parent2a473dbecab2b47c513de9127a2cddf4c2800306 (diff)
downloadpdfium-f51a02a29e10fcc490ba28f44d43f50104f940ed.tar.xz
Cleanup codepage and charset definitions.
This Cl cleans up the unused defines in fx_codepage.h. The FXFONT_CHARSET_ defines are replaced with fx_codepage defines, this moves fx_codepage into core instead of xfa only. Static asserts are added to verify the public/ charsets match the fx_codepage charsets. Change-Id: Ie2f749e093de60a9a6743128a1fb087912e4cc96 Reviewed-on: https://pdfium-review.googlesource.com/4316 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/cfx_systemhandler.cpp')
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index 906954354b..277e34b18c 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -9,6 +9,7 @@
#include <memory>
#include "core/fpdfapi/parser/cpdf_document.h"
+#include "core/fxcrt/fx_codepage.h"
#include "core/fxge/cfx_fontmapper.h"
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
@@ -21,15 +22,15 @@
namespace {
int CharSet2CP(int charset) {
- if (charset == FXFONT_SHIFTJIS_CHARSET)
- return 932;
- if (charset == FXFONT_GB2312_CHARSET)
- return 936;
- if (charset == FXFONT_HANGUL_CHARSET)
- return 949;
- if (charset == FXFONT_CHINESEBIG5_CHARSET)
- return 950;
- return 0;
+ 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