From 0c7cf97859dd38f2cd94532cdd423abff7130853 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sat, 11 Aug 2018 05:37:47 +0000 Subject: Cleanup CFX_CTTGSUBTable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do all the parsing inside the constructor. Make GetVerticalGlyph() and related getters const methods. Change-Id: I21118cf98048cb6bbfc0999604d2434d4acafef6 Reviewed-on: https://pdfium-review.googlesource.com/39496 Commit-Queue: Lei Zhang Reviewed-by: Nicolás Peña Moreno --- core/fpdfapi/font/cfx_cttgsubtable.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi/font/cfx_cttgsubtable.h') diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h index fc1caf5ef2..ff488a5ed7 100644 --- a/core/fpdfapi/font/cfx_cttgsubtable.h +++ b/core/fpdfapi/font/cfx_cttgsubtable.h @@ -17,11 +17,10 @@ class CFX_CTTGSUBTable { public: - CFX_CTTGSUBTable(); + explicit CFX_CTTGSUBTable(FT_Bytes gsub); ~CFX_CTTGSUBTable(); - bool LoadGSUBTable(FT_Bytes gsub); - bool GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum); + uint32_t GetVerticalGlyph(uint32_t glyphnum) const; private: struct TLangSysRecord { @@ -118,6 +117,7 @@ class CFX_CTTGSUBTable { std::vector> SubTables; }; + bool LoadGSUBTable(FT_Bytes gsub); bool Parse(FT_Bytes scriptlist, FT_Bytes featurelist, FT_Bytes lookuplist); void ParseScriptList(FT_Bytes raw); void ParseScript(FT_Bytes raw, TScriptRecord* rec); @@ -133,12 +133,12 @@ class CFX_CTTGSUBTable { void ParseSingleSubstFormat1(FT_Bytes raw, TSubTable1* rec); void ParseSingleSubstFormat2(FT_Bytes raw, TSubTable2* rec); - bool GetVerticalGlyphSub(uint32_t glyphnum, - uint32_t* vglyphnum, - TFeatureRecord* Feature); - bool GetVerticalGlyphSub2(uint32_t glyphnum, - uint32_t* vglyphnum, - TLookup* Lookup); + bool GetVerticalGlyphSub(const TFeatureRecord& feature, + uint32_t glyphnum, + uint32_t* vglyphnum) const; + bool GetVerticalGlyphSub2(const TLookup& lookup, + uint32_t glyphnum, + uint32_t* vglyphnum) const; int GetCoverageIndex(TCoverageFormatBase* Coverage, uint32_t g) const; uint8_t GetUInt8(FT_Bytes& p) const; @@ -148,7 +148,6 @@ class CFX_CTTGSUBTable { uint32_t GetUInt32(FT_Bytes& p) const; std::set m_featureSet; - bool m_bFeautureMapLoad; std::vector ScriptList; std::vector FeatureList; std::vector LookupList; -- cgit v1.2.3