diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-26 17:20:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-26 17:20:28 +0000 |
commit | 785da23f6cce8004b8e7759345abd877dab953ea (patch) | |
tree | a1f15eb6e7c9b32c08803f775c01dd5e3225c206 /core/fpdfapi/font/cpdf_cid2unicodemap.cpp | |
parent | e529390fd5b521e4c223343a4b367b0ced357ed5 (diff) | |
download | pdfium-785da23f6cce8004b8e7759345abd877dab953ea.tar.xz |
Use pdfium::span in CPDF_CID2UnicodeMap.
Change-Id: Ie63f622674d9085fa45642c15e7ee8b22ca98555
Reviewed-on: https://pdfium-review.googlesource.com/36130
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_cid2unicodemap.cpp')
-rw-r--r-- | core/fpdfapi/font/cpdf_cid2unicodemap.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/core/fpdfapi/font/cpdf_cid2unicodemap.cpp b/core/fpdfapi/font/cpdf_cid2unicodemap.cpp index 650856419a..b2e435b5f1 100644 --- a/core/fpdfapi/font/cpdf_cid2unicodemap.cpp +++ b/core/fpdfapi/font/cpdf_cid2unicodemap.cpp @@ -10,23 +10,21 @@ #include "core/fpdfapi/font/cpdf_cmapmanager.h" #include "core/fpdfapi/page/cpdf_pagemodule.h" -CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap() { - m_EmbeddedCount = 0; -} +CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap() = default; -CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap() {} +CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap() = default; -bool CPDF_CID2UnicodeMap::IsLoaded() { - return m_EmbeddedCount != 0; +bool CPDF_CID2UnicodeMap::IsLoaded() const { + return !m_pEmbeddedMap.empty(); } -wchar_t CPDF_CID2UnicodeMap::UnicodeFromCID(uint16_t CID) { - if (m_Charset == CIDSET_UNICODE) { +wchar_t CPDF_CID2UnicodeMap::UnicodeFromCID(uint16_t CID) const { + if (m_Charset == CIDSET_UNICODE) return CID; - } - if (CID < m_EmbeddedCount) { + + if (CID < m_pEmbeddedMap.size()) return m_pEmbeddedMap[CID]; - } + return 0; } @@ -37,6 +35,6 @@ void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals(); - std::tie(m_EmbeddedCount, m_pEmbeddedMap) = - pFontGlobals->GetEmbeddedToUnicode(charset); + + m_pEmbeddedMap = pFontGlobals->GetEmbeddedToUnicode(charset); } |