summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-26 19:48:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-26 19:48:59 +0000
commitc4dce690f433a41c4429e872c2306e09b14c5d9f (patch)
tree43990b61718628e7731fb8b6bf7c12e4df04b8ff /core/fpdfapi/font
parentca386ad150be28116997b713056a4a2197c7b7e8 (diff)
downloadpdfium-c4dce690f433a41c4429e872c2306e09b14c5d9f.tar.xz
Use pdfium::span<> in cpdf_fontglobals.h
Required moving some sizes to .h file for default construction of spans from c-style arrays. Change-Id: I45c42103f3575bc83e57a085ad4e8f16698468d3 Reviewed-on: https://pdfium-review.googlesource.com/36190 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/cpdf_fontglobals.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/core/fpdfapi/font/cpdf_fontglobals.h b/core/fpdfapi/font/cpdf_fontglobals.h
index 2663490925..d5156aae65 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.h
+++ b/core/fpdfapi/font/cpdf_fontglobals.h
@@ -29,36 +29,25 @@ class CPDF_FontGlobals {
uint32_t index,
std::unique_ptr<CPDF_Font> pFont);
- void SetEmbeddedCharset(size_t idx, const FXCMAP_CMap* map, uint32_t count) {
- m_EmbeddedCharsets[idx].m_pMapList = map;
- m_EmbeddedCharsets[idx].m_Count = count;
+ void SetEmbeddedCharset(size_t idx, pdfium::span<const FXCMAP_CMap> map) {
+ m_EmbeddedCharsets[idx] = map;
}
- std::pair<uint32_t, const FXCMAP_CMap*> GetEmbeddedCharset(size_t idx) const {
- return {m_EmbeddedCharsets[idx].m_Count,
- m_EmbeddedCharsets[idx].m_pMapList.Get()};
+ pdfium::span<const FXCMAP_CMap> GetEmbeddedCharset(size_t idx) const {
+ return m_EmbeddedCharsets[idx];
}
- void SetEmbeddedToUnicode(size_t idx, const uint16_t* map, uint32_t count) {
- m_EmbeddedToUnicodes[idx].m_pMap = map;
- m_EmbeddedToUnicodes[idx].m_Count = count;
+ void SetEmbeddedToUnicode(size_t idx, pdfium::span<const uint16_t> map) {
+ m_EmbeddedToUnicodes[idx] = map;
}
pdfium::span<const uint16_t> GetEmbeddedToUnicode(size_t idx) {
- return pdfium::make_span(m_EmbeddedToUnicodes[idx].m_pMap,
- m_EmbeddedToUnicodes[idx].m_Count);
+ return m_EmbeddedToUnicodes[idx];
}
CPDF_CMapManager* GetCMapManager() { return &m_CMapManager; }
private:
CPDF_CMapManager m_CMapManager;
- struct {
- UnownedPtr<const FXCMAP_CMap> m_pMapList;
- uint32_t m_Count;
- } m_EmbeddedCharsets[CIDSET_NUM_SETS];
- struct {
- const uint16_t* m_pMap;
- uint32_t m_Count;
- } m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
-
+ pdfium::span<const FXCMAP_CMap> m_EmbeddedCharsets[CIDSET_NUM_SETS];
+ pdfium::span<const uint16_t> m_EmbeddedToUnicodes[CIDSET_NUM_SETS];
std::map<CPDF_Document*, std::unique_ptr<CFX_StockFontArray>> m_StockMap;
};