diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-19 14:26:46 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-19 14:26:46 -0800 |
commit | 11d33361e95d5ea61ee43e4261fa8f53aa372731 (patch) | |
tree | df81483804ef757d6f3c6f91531e7deae1eebf42 /core/include/fpdfapi | |
parent | 84e5a12f186a00bf37a26cc13965f65c25561bd1 (diff) | |
download | pdfium-11d33361e95d5ea61ee43e4261fa8f53aa372731.tar.xz |
Get rid of CFX_CharMap instantiations.
The only thing left are a couple of static methods.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1711273002 .
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r-- | core/include/fpdfapi/fpdf_objects.h | 13 | ||||
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 20 |
2 files changed, 10 insertions, 23 deletions
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index ddc16d95b0..129eebfcfc 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -58,9 +58,7 @@ class CPDF_Object { virtual CFX_ByteString GetString() const { return CFX_ByteString(); } virtual CFX_ByteStringC GetConstString() const { return CFX_ByteStringC(); } - virtual CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = nullptr) const { - return CFX_WideString(); - } + virtual CFX_WideString GetUnicodeText() const { return CFX_WideString(); } virtual FX_FLOAT GetNumber() const { return 0; } virtual int GetInteger() const { return 0; } virtual CPDF_Dictionary* GetDict() const { return nullptr; } @@ -207,7 +205,7 @@ class CPDF_String : public CPDF_Object { CFX_ByteStringC GetConstString() const override { return CFX_ByteStringC(m_String); } - CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = nullptr) const override; + CFX_WideString GetUnicodeText() const override; void SetString(const CFX_ByteString& str) override { m_String = str; } bool IsString() const override { return true; } CPDF_String* AsString() override { return this; } @@ -245,7 +243,7 @@ class CPDF_Name : public CPDF_Object { CFX_ByteStringC GetConstString() const override { return CFX_ByteStringC(m_Name); } - CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = nullptr) const override; + CFX_WideString GetUnicodeText() const override; void SetString(const CFX_ByteString& str) override { m_Name = str; } bool IsName() const override { return true; } CPDF_Name* AsName() override { return this; } @@ -355,8 +353,7 @@ class CPDF_Dictionary : public CPDF_Object { const CFX_ByteStringC& default_str) const; CFX_ByteStringC GetConstStringBy(const CFX_ByteStringC& key, const CFX_ByteStringC& default_str) const; - CFX_WideString GetUnicodeTextBy(const CFX_ByteStringC& key, - CFX_CharMap* pCharMap = NULL) const; + CFX_WideString GetUnicodeTextBy(const CFX_ByteStringC& key) const; int GetIntegerBy(const CFX_ByteStringC& key) const; int GetIntegerBy(const CFX_ByteStringC& key, int default_int) const; FX_BOOL GetBooleanBy(const CFX_ByteStringC& key, @@ -428,7 +425,7 @@ class CPDF_Stream : public CPDF_Object { Type GetType() const override { return STREAM; } CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override; CPDF_Dictionary* GetDict() const override { return m_pDict; } - CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = nullptr) const override; + CFX_WideString GetUnicodeText() const override; bool IsStream() const override { return true; } CPDF_Stream* AsStream() override { return this; } const CPDF_Stream* AsStream() const override { return this; } diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index f57ee5593c..9fa05c75ed 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -697,21 +697,11 @@ CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE); -CFX_WideString PDF_DecodeText(const uint8_t* pData, - FX_DWORD size, - CFX_CharMap* pCharMap = NULL); -inline CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, - CFX_CharMap* pCharMap = NULL) { - return PDF_DecodeText((const uint8_t*)bstr.c_str(), bstr.GetLength(), - pCharMap); -} -CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, - int len = -1, - CFX_CharMap* pCharMap = NULL); -inline CFX_ByteString PDF_EncodeText(const CFX_WideString& str, - CFX_CharMap* pCharMap = NULL) { - return PDF_EncodeText(str.c_str(), str.GetLength(), pCharMap); -} +CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size); +CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); +CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); +CFX_ByteString PDF_EncodeText(const CFX_WideString& str); + FX_FLOAT PDF_ClipFloat(FX_FLOAT f); class CFDF_Document : public CPDF_IndirectObjectHolder { public: |