summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-29 19:32:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-29 19:32:47 +0000
commit1934a24ffdd8cd27b67fda6dc81cd4420d024db0 (patch)
tree514e968715388b7a86ee66bc575d2e21f11fceb7 /xfa/fxfa/parser
parentb2b1f55214688d5e3bfd5015e0a4829d2f314c27 (diff)
downloadpdfium-1934a24ffdd8cd27b67fda6dc81cd4420d024db0.tar.xz
Use pdfium::span<> in fpdf_parser_decode.h helper functions.
Change-Id: Ib0a2bd21fe4304163cf9c080e07475e7c033c299 Reviewed-on: https://pdfium-review.googlesource.com/41570 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_localemgr.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp
index a6d5b148d8..55ba04bbb0 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_localemgr.cpp
@@ -1066,16 +1066,16 @@ const uint8_t g_ruRU_Locale[] = {
0xB3, 0x85, 0xFA, 0x59, 0x2A, 0x7A, 0xFF, 0x3D, 0xC4, 0x3F, 0xDE, 0xCB,
0x8B, 0xC4};
-std::unique_ptr<LocaleIface> GetLocaleFromBuffer(const uint8_t* pBuf,
- int nBufLen) {
- if (!pBuf || nBufLen <= 0)
+std::unique_ptr<LocaleIface> GetLocaleFromBuffer(
+ pdfium::span<const uint8_t> src_span) {
+ if (src_span.empty())
return nullptr;
uint8_t* pOut = nullptr;
uint32_t dwSize;
CCodec_ModuleMgr* pCodecMgr = CPDF_ModuleMgr::Get()->GetCodecModule();
- pCodecMgr->GetFlateModule()->FlateOrLZWDecode(false, pBuf, nBufLen, true, 0,
- 0, 0, 0, 0, &pOut, &dwSize);
+ pCodecMgr->GetFlateModule()->FlateOrLZWDecode(false, src_span, true, 0, 0, 0,
+ 0, 0, &pOut, &dwSize);
if (!pOut)
return nullptr;
@@ -1164,36 +1164,36 @@ LocaleIface* CXFA_LocaleMgr::GetDefLocale() {
std::unique_ptr<LocaleIface> CXFA_LocaleMgr::GetLocale(uint16_t lcid) {
switch (lcid) {
case FX_LANG_zh_CN:
- return GetLocaleFromBuffer(g_zhCN_Locale, sizeof(g_zhCN_Locale));
+ return GetLocaleFromBuffer(g_zhCN_Locale);
case FX_LANG_zh_TW:
- return GetLocaleFromBuffer(g_zhTW_Locale, sizeof(g_zhTW_Locale));
+ return GetLocaleFromBuffer(g_zhTW_Locale);
case FX_LANG_zh_HK:
- return GetLocaleFromBuffer(g_zhHK_Locale, sizeof(g_zhHK_Locale));
+ return GetLocaleFromBuffer(g_zhHK_Locale);
case FX_LANG_ja_JP:
- return GetLocaleFromBuffer(g_jaJP_Locale, sizeof(g_jaJP_Locale));
+ return GetLocaleFromBuffer(g_jaJP_Locale);
case FX_LANG_ko_KR:
- return GetLocaleFromBuffer(g_koKR_Locale, sizeof(g_koKR_Locale));
+ return GetLocaleFromBuffer(g_koKR_Locale);
case FX_LANG_en_GB:
- return GetLocaleFromBuffer(g_enGB_Locale, sizeof(g_enGB_Locale));
+ return GetLocaleFromBuffer(g_enGB_Locale);
case FX_LANG_es_LA:
- return GetLocaleFromBuffer(g_esLA_Locale, sizeof(g_esLA_Locale));
+ return GetLocaleFromBuffer(g_esLA_Locale);
case FX_LANG_es_ES:
- return GetLocaleFromBuffer(g_esES_Locale, sizeof(g_esES_Locale));
+ return GetLocaleFromBuffer(g_esES_Locale);
case FX_LANG_de_DE:
- return GetLocaleFromBuffer(g_deDE_Loacale, sizeof(g_deDE_Loacale));
+ return GetLocaleFromBuffer(g_deDE_Loacale);
case FX_LANG_fr_FR:
- return GetLocaleFromBuffer(g_frFR_Locale, sizeof(g_frFR_Locale));
+ return GetLocaleFromBuffer(g_frFR_Locale);
case FX_LANG_it_IT:
- return GetLocaleFromBuffer(g_itIT_Locale, sizeof(g_itIT_Locale));
+ return GetLocaleFromBuffer(g_itIT_Locale);
case FX_LANG_pt_BR:
- return GetLocaleFromBuffer(g_ptBR_Locale, sizeof(g_ptBR_Locale));
+ return GetLocaleFromBuffer(g_ptBR_Locale);
case FX_LANG_nl_NL:
- return GetLocaleFromBuffer(g_nlNL_Locale, sizeof(g_nlNL_Locale));
+ return GetLocaleFromBuffer(g_nlNL_Locale);
case FX_LANG_ru_RU:
- return GetLocaleFromBuffer(g_ruRU_Locale, sizeof(g_ruRU_Locale));
+ return GetLocaleFromBuffer(g_ruRU_Locale);
case FX_LANG_en_US:
default:
- return GetLocaleFromBuffer(g_enUS_Locale, sizeof(g_enUS_Locale));
+ return GetLocaleFromBuffer(g_enUS_Locale);
}
}