summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cfx_cttgsubtable.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-12-01 19:10:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-01 19:10:32 +0000
commitaab84f9a9fcb19296e45625901243e87ae813a4e (patch)
treeafab01ae29cc76b1f51e7fa00d6e47262cdbc3b5 /core/fpdfapi/font/cfx_cttgsubtable.h
parent1f0d1fda6db83ee402561902c76ae8a6da124663 (diff)
downloadpdfium-aab84f9a9fcb19296e45625901243e87ae813a4e.tar.xz
Remove unneded structs from CFX_CTTGSUBTable part 2
This CL continues removing structs from CFX_CTTGSUBTable Change-Id: I1ede1e3e736f87292b6119406fd5f12a0bb7e7cb Reviewed-on: https://pdfium-review.googlesource.com/20170 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cfx_cttgsubtable.h')
-rw-r--r--core/fpdfapi/font/cfx_cttgsubtable.h160
1 files changed, 32 insertions, 128 deletions
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h
index fc8d125f3e..8722bf665c 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.h
+++ b/core/fpdfapi/font/cfx_cttgsubtable.h
@@ -25,95 +25,45 @@ class CFX_CTTGSUBTable {
bool GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum);
private:
- struct TLangSys {
- TLangSys();
- ~TLangSys();
+ struct TLangSysRecord {
+ TLangSysRecord();
+ ~TLangSysRecord();
+ uint32_t LangSysTag;
uint16_t LookupOrder;
uint16_t ReqFeatureIndex;
std::vector<uint16_t> FeatureIndices;
-
- private:
- TLangSys(const TLangSys&) = delete;
- TLangSys& operator=(const TLangSys&) = delete;
- };
-
- struct TLangSysRecord {
- TLangSysRecord() : LangSysTag(0) {}
-
- uint32_t LangSysTag;
- TLangSys LangSys;
-
- private:
- TLangSysRecord(const TLangSysRecord&) = delete;
- TLangSysRecord& operator=(const TLangSysRecord&) = delete;
- };
-
- struct TScript {
- TScript();
- ~TScript();
-
- uint16_t DefaultLangSys;
- std::vector<TLangSysRecord> LangSysRecords;
-
- private:
- TScript(const TScript&) = delete;
- TScript& operator=(const TScript&) = delete;
};
struct TScriptRecord {
- TScriptRecord() : ScriptTag(0) {}
+ TScriptRecord();
+ ~TScriptRecord();
uint32_t ScriptTag;
- TScript Script;
-
- private:
- TScriptRecord(const TScriptRecord&) = delete;
- TScriptRecord& operator=(const TScriptRecord&) = delete;
+ uint16_t DefaultLangSys;
+ std::vector<TLangSysRecord> LangSysRecords;
};
- struct TFeature {
- TFeature();
- ~TFeature();
+ struct TFeatureRecord {
+ TFeatureRecord();
+ ~TFeatureRecord();
+ uint32_t FeatureTag;
uint16_t FeatureParams;
std::vector<uint16_t> LookupListIndices;
-
- private:
- TFeature(const TFeature&) = delete;
- TFeature& operator=(const TFeature&) = delete;
};
- struct TFeatureRecord {
- TFeatureRecord() : FeatureTag(0) {}
-
- uint32_t FeatureTag;
- TFeature Feature;
-
- private:
- TFeatureRecord(const TFeatureRecord&) = delete;
- TFeatureRecord& operator=(const TFeatureRecord&) = delete;
- };
+ struct TRangeRecord {
+ TRangeRecord();
- enum TLookupFlag {
- LOOKUPFLAG_RightToLeft = 0x0001,
- LOOKUPFLAG_IgnoreBaseGlyphs = 0x0002,
- LOOKUPFLAG_IgnoreLigatures = 0x0004,
- LOOKUPFLAG_IgnoreMarks = 0x0008,
- LOOKUPFLAG_Reserved = 0x00F0,
- LOOKUPFLAG_MarkAttachmentType = 0xFF00,
+ uint16_t Start;
+ uint16_t End;
+ uint16_t StartCoverageIndex;
};
struct TCoverageFormatBase {
- TCoverageFormatBase() : CoverageFormat(0) {}
- explicit TCoverageFormatBase(uint16_t format) : CoverageFormat(format) {}
virtual ~TCoverageFormatBase() {}
-
uint16_t CoverageFormat;
-
- private:
- TCoverageFormatBase(const TCoverageFormatBase&);
- TCoverageFormatBase& operator=(const TCoverageFormatBase&);
};
struct TCoverageFormat1 : public TCoverageFormatBase {
@@ -121,25 +71,6 @@ class CFX_CTTGSUBTable {
~TCoverageFormat1() override;
std::vector<uint16_t> GlyphArray;
-
- private:
- TCoverageFormat1(const TCoverageFormat1&) = delete;
- TCoverageFormat1& operator=(const TCoverageFormat1&) = delete;
- };
-
- struct TRangeRecord {
- TRangeRecord();
-
- friend bool operator>(const TRangeRecord& r1, const TRangeRecord& r2) {
- return r1.Start > r2.Start;
- }
-
- uint16_t Start;
- uint16_t End;
- uint16_t StartCoverageIndex;
-
- private:
- TRangeRecord(const TRangeRecord&) = delete;
};
struct TCoverageFormat2 : public TCoverageFormatBase {
@@ -147,10 +78,6 @@ class CFX_CTTGSUBTable {
~TCoverageFormat2() override;
std::vector<TRangeRecord> RangeRecords;
-
- private:
- TCoverageFormat2(const TCoverageFormat2&) = delete;
- TCoverageFormat2& operator=(const TCoverageFormat2&) = delete;
};
struct TDevice {
@@ -159,46 +86,28 @@ class CFX_CTTGSUBTable {
uint16_t StartSize;
uint16_t EndSize;
uint16_t DeltaFormat;
-
- private:
- TDevice(const TDevice&) = delete;
- TDevice& operator=(const TDevice&) = delete;
};
struct TSubTableBase {
- TSubTableBase() : SubstFormat(0) {}
- explicit TSubTableBase(uint16_t format) : SubstFormat(format) {}
- virtual ~TSubTableBase() {}
+ TSubTableBase();
+ virtual ~TSubTableBase();
+ std::unique_ptr<TCoverageFormatBase> Coverage;
uint16_t SubstFormat;
-
- private:
- TSubTableBase(const TSubTableBase&) = delete;
- TSubTableBase& operator=(const TSubTableBase&) = delete;
};
- struct TSingleSubstFormat1 : public TSubTableBase {
- TSingleSubstFormat1();
- ~TSingleSubstFormat1() override;
+ struct TSubTable1 : public TSubTableBase {
+ TSubTable1();
+ ~TSubTable1() override;
- std::unique_ptr<TCoverageFormatBase> Coverage;
int16_t DeltaGlyphID;
-
- private:
- TSingleSubstFormat1(const TSingleSubstFormat1&) = delete;
- TSingleSubstFormat1& operator=(const TSingleSubstFormat1&) = delete;
};
- struct TSingleSubstFormat2 : public TSubTableBase {
- TSingleSubstFormat2();
- ~TSingleSubstFormat2() override;
+ struct TSubTable2 : public TSubTableBase {
+ TSubTable2();
+ ~TSubTable2() override;
- std::unique_ptr<TCoverageFormatBase> Coverage;
std::vector<uint16_t> Substitutes;
-
- private:
- TSingleSubstFormat2(const TSingleSubstFormat2&) = delete;
- TSingleSubstFormat2& operator=(const TSingleSubstFormat2&) = delete;
};
struct TLookup {
@@ -208,30 +117,26 @@ class CFX_CTTGSUBTable {
uint16_t LookupType;
uint16_t LookupFlag;
std::vector<std::unique_ptr<TSubTableBase>> SubTables;
-
- private:
- TLookup(const TLookup&) = delete;
- TLookup& operator=(const TLookup&) = delete;
};
bool Parse(FT_Bytes scriptlist, FT_Bytes featurelist, FT_Bytes lookuplist);
void ParseScriptList(FT_Bytes raw);
- void ParseScript(FT_Bytes raw, TScript* rec);
- void ParseLangSys(FT_Bytes raw, TLangSys* rec);
+ void ParseScript(FT_Bytes raw, TScriptRecord* rec);
+ void ParseLangSys(FT_Bytes raw, TLangSysRecord* rec);
void ParseFeatureList(FT_Bytes raw);
- void ParseFeature(FT_Bytes raw, TFeature* rec);
+ void ParseFeature(FT_Bytes raw, TFeatureRecord* rec);
void ParseLookupList(FT_Bytes raw);
void ParseLookup(FT_Bytes raw, TLookup* rec);
std::unique_ptr<TCoverageFormatBase> ParseCoverage(FT_Bytes raw);
void ParseCoverageFormat1(FT_Bytes raw, TCoverageFormat1* rec);
void ParseCoverageFormat2(FT_Bytes raw, TCoverageFormat2* rec);
void ParseSingleSubst(FT_Bytes raw, std::unique_ptr<TSubTableBase>* rec);
- void ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1* rec);
- void ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2* rec);
+ void ParseSingleSubstFormat1(FT_Bytes raw, TSubTable1* rec);
+ void ParseSingleSubstFormat2(FT_Bytes raw, TSubTable2* rec);
bool GetVerticalGlyphSub(uint32_t glyphnum,
uint32_t* vglyphnum,
- TFeature* Feature);
+ TFeatureRecord* Feature);
bool GetVerticalGlyphSub2(uint32_t glyphnum,
uint32_t* vglyphnum,
TLookup* Lookup);
@@ -245,7 +150,6 @@ class CFX_CTTGSUBTable {
std::set<uint32_t> m_featureSet;
bool m_bFeautureMapLoad;
- bool loaded;
std::vector<TScriptRecord> ScriptList;
std::vector<TFeatureRecord> FeatureList;
std::vector<TLookup> LookupList;