summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
committerLei Zhang <thestig@chromium.org>2015-10-16 16:22:37 -0700
commitc40ccaff017691b7d31e0597863bfb954aebd739 (patch)
tree4f5f09c672393e130037826256ab182e2d2ae7f5 /core/include/fpdfapi
parenta725bc9a3525256976c112b2b5a429a119cf9b69 (diff)
downloadpdfium-c40ccaff017691b7d31e0597863bfb954aebd739.tar.xz
Merge to XFA: Fix a bunch of sign mismatch warnings.
Also remove some gotos and move code into an anonymous namespace. And then do the partial revert to avoid size_t going negative. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 . Review URL: https://codereview.chromium.org/1400723002 . (cherry picked from commit d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd) (cherry picked from commit a398ca611d1925182ff6a4e8b2b43c277c364dc0) Review URL: https://codereview.chromium.org/1406373002 .
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index d687c97b9c..9fe6e2b95f 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -414,13 +414,15 @@ class CPDF_Type3Font : public CPDF_SimpleFont {
CFX_MapPtrToPtr m_DeletedMap;
};
-#define CIDSET_UNKNOWN 0
-#define CIDSET_GB1 1
-#define CIDSET_CNS1 2
-#define CIDSET_JAPAN1 3
-#define CIDSET_KOREA1 4
-#define CIDSET_UNICODE 5
-#define NUMBER_OF_CIDSETS 6
+enum CIDSet {
+ CIDSET_UNKNOWN,
+ CIDSET_GB1,
+ CIDSET_CNS1,
+ CIDSET_JAPAN1,
+ CIDSET_KOREA1,
+ CIDSET_UNICODE,
+ CIDSET_NUM_SETS
+};
class CPDF_CIDFont : public CPDF_Font {
public:
@@ -428,6 +430,8 @@ class CPDF_CIDFont : public CPDF_Font {
~CPDF_CIDFont() override;
+ static FX_FLOAT CIDTransformToFloat(uint8_t ch);
+
FX_BOOL LoadGB2312();
int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override;
int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
@@ -442,9 +446,6 @@ class CPDF_CIDFont : public CPDF_Font {
int CountChar(const FX_CHAR* pString, int size) const override;
int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override;
int GetCharSize(FX_DWORD charcode) const override;
-
- int GetCharset() const { return m_Charset; }
-
const uint8_t* GetCIDTransform(FX_WORD CID) const;
FX_BOOL IsVertWriting() const override;
short GetVertWidth(FX_WORD CID) const;
@@ -467,7 +468,7 @@ class CPDF_CIDFont : public CPDF_Font {
CPDF_CMap* m_pCMap;
CPDF_CMap* m_pAllocatedCMap;
CPDF_CID2UnicodeMap* m_pCID2UnicodeMap;
- int m_Charset;
+ CIDSet m_Charset;
FX_BOOL m_bType1;
CPDF_StreamAcc* m_pCIDToGIDMap;
FX_BOOL m_bCIDIsGID;