diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-14 17:06:23 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-14 17:06:23 -0700 |
commit | 759247991b5f1df71335294e6bfe3e3fe7aec7b4 (patch) | |
tree | 3de1b72b34c3eae83f4b9fa58e978a643ff0bf6a /core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp | |
parent | dacc22cdfea727a04bce086d9bfec9a4d1a29bd4 (diff) | |
download | pdfium-759247991b5f1df71335294e6bfe3e3fe7aec7b4.tar.xz |
Move extern cmap declarations from .cpp files into new .h files.
That way, the compiler can check them against the definitions rather
than just relying on the linker to line things up.
Make the types of the declarations and definitions match exactly,
instead of being synonym typedefs of each other.
Fix some IWYU and use FX_ArraySize where possible.
BUG=https://code.google.com/p/pdfium/issues/detail?id=178
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1221503005 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp index 748535b1c0..6e67bfb0ce 100644 --- a/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp +++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp @@ -6,20 +6,12 @@ #include "../../../../include/fpdfapi/fpdf_resource.h" #include "../../../../include/fpdfapi/fpdf_module.h" +#include "../../../../include/fxcrt/fx_basic.h" // For FX_ArraySize(). #include "../../fpdf_font/font_int.h" #include "../cmap_int.h" -extern const FX_WORD g_FXCMAP_KSC_EUC_H_0[]; -extern const FX_WORD g_FXCMAP_KSC_EUC_V_0[]; -extern const FX_WORD g_FXCMAP_KSCms_UHC_H_1[]; -extern const FX_WORD g_FXCMAP_KSCms_UHC_V_1[]; -extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_H_1[]; -extern const FX_WORD g_FXCMAP_KSCms_UHC_HW_V_1[]; -extern const FX_WORD g_FXCMAP_KSCpc_EUC_H_0[]; -extern const FX_WORD g_FXCMAP_UniKS_UCS2_H_1[]; -extern const FX_WORD g_FXCMAP_UniKS_UCS2_V_1[]; -extern const FX_WORD g_FXCMAP_UniKS_UTF16_H_0[]; -extern const FX_WORD g_FXCMAP_Korea1CID2Unicode_2[]; -const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = { +#include "cmaps_korea1.h" + +static const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = { { "KSC-EUC-H", FXCMAP_CMap::Range, g_FXCMAP_KSC_EUC_H_0, 467, FXCMAP_CMap::None, NULL, 0, 0 }, { "KSC-EUC-V", FXCMAP_CMap::Range, g_FXCMAP_KSC_EUC_V_0, 16, FXCMAP_CMap::None, NULL, 0, -1 }, { "KSCms-UHC-H", FXCMAP_CMap::Range, g_FXCMAP_KSCms_UHC_H_1, 675, FXCMAP_CMap::None, NULL, 0, -2 }, @@ -32,11 +24,12 @@ const FXCMAP_CMap g_FXCMAP_Korea1_cmaps[] = { { "UniKS-UTF16-H", FXCMAP_CMap::Single, g_FXCMAP_UniKS_UTF16_H_0, 158, FXCMAP_CMap::None, NULL, 0, -2 }, { "UniKS-UTF16-V", FXCMAP_CMap::Range, g_FXCMAP_UniKS_UCS2_V_1, 18, FXCMAP_CMap::None, NULL, 0, -1 }, }; + void CPDF_ModuleMgr::LoadEmbeddedKorea1CMaps() { CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_pMapList = g_FXCMAP_Korea1_cmaps; - pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_Count = sizeof g_FXCMAP_Korea1_cmaps / sizeof (FXCMAP_CMap); + pFontGlobals->m_EmbeddedCharsets[CIDSET_KOREA1].m_Count = FX_ArraySize(g_FXCMAP_Korea1_cmaps); pFontGlobals->m_EmbeddedToUnicodes[CIDSET_KOREA1].m_pMap = g_FXCMAP_Korea1CID2Unicode_2; pFontGlobals->m_EmbeddedToUnicodes[CIDSET_KOREA1].m_Count = 18352; } |