From 75a205f03fb755f4766ea674e470ff8de5d905b7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 4 Oct 2017 14:54:32 -0400 Subject: Remove CPDF_CMap friends This CL removes the friends from CPDF_CMap and adds accessors for the needed items. Change-Id: Icf7b3e639c0904209f7db80c9460146cd29dd78a Reviewed-on: https://pdfium-review.googlesource.com/15452 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- core/fpdfapi/font/cpdf_cmap.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/font/cpdf_cmap.h') diff --git a/core/fpdfapi/font/cpdf_cmap.h b/core/fpdfapi/font/cpdf_cmap.h index 493d30097a..98a77286d0 100644 --- a/core/fpdfapi/font/cpdf_cmap.h +++ b/core/fpdfapi/font/cpdf_cmap.h @@ -57,16 +57,33 @@ class CPDF_CMap : public Retainable { bool IsLoaded() const { return m_bLoaded; } bool IsVertWriting() const { return m_bVertical; } + uint16_t CIDFromCharCode(uint32_t charcode) const; + int GetCharSize(uint32_t charcode) const; uint32_t GetNextChar(const char* pString, int nStrLen, int& offset) const; int CountChar(const char* pString, int size) const; int AppendChar(char* str, uint32_t charcode) const; - private: - friend class CPDF_CMapParser; - friend class CPDF_CIDFont; + void SetVertical(bool vert) { m_bVertical = vert; } + void SetCodingScheme(CodingScheme scheme) { m_CodingScheme = scheme; } + void SetMixedFourByteLeadingRanges(std::vector range) { + m_MixedFourByteLeadingRanges = range; + } + int GetCoding() const { return m_Coding; } + const FXCMAP_CMap* GetEmbedMap() const { return m_pEmbedMap; } + CIDSet GetCharset() const { return m_Charset; } + void SetCharset(CIDSet set) { m_Charset = set; } + + void SetDirectCharcodeToCIDTable(size_t idx, uint16_t val) { + m_DirectCharcodeToCIDTable[idx] = val; + } + bool IsDirectCharcodeToCIDTableIsEmpty() const { + return m_DirectCharcodeToCIDTable.empty(); + } + + private: CPDF_CMap(); ~CPDF_CMap() override; -- cgit v1.2.3