diff options
-rw-r--r-- | core/fpdfapi/fpdf_font/cpdf_font.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_font/include/cpdf_font.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp index 78bdeeffaa..c15ac6b445 100644 --- a/core/fpdfapi/fpdf_font/cpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp @@ -165,7 +165,7 @@ void CPDF_Font::AppendChar(CFX_ByteString& str, uint32_t charcode) const { CFX_WideString CPDF_Font::UnicodeFromCharCode(uint32_t charcode) const { if (!m_bToUnicodeLoaded) - ((CPDF_Font*)this)->LoadUnicodeMap(); + LoadUnicodeMap(); if (m_pToUnicodeMap) return m_pToUnicodeMap->Lookup(charcode); @@ -174,7 +174,7 @@ CFX_WideString CPDF_Font::UnicodeFromCharCode(uint32_t charcode) const { uint32_t CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const { if (!m_bToUnicodeLoaded) - ((CPDF_Font*)this)->LoadUnicodeMap(); + LoadUnicodeMap(); if (m_pToUnicodeMap) return m_pToUnicodeMap->ReverseLookup(unicode); @@ -294,7 +294,7 @@ void CPDF_Font::CheckFontMetrics() { } } -void CPDF_Font::LoadUnicodeMap() { +void CPDF_Font::LoadUnicodeMap() const { m_bToUnicodeLoaded = TRUE; CPDF_Stream* pStream = m_pFontDict->GetStreamBy("ToUnicode"); if (!pStream) { diff --git a/core/fpdfapi/fpdf_font/include/cpdf_font.h b/core/fpdfapi/fpdf_font/include/cpdf_font.h index 81518408e7..31badd2656 100644 --- a/core/fpdfapi/fpdf_font/include/cpdf_font.h +++ b/core/fpdfapi/fpdf_font/include/cpdf_font.h @@ -99,7 +99,7 @@ class CPDF_Font { virtual FX_BOOL Load() = 0; FX_BOOL Initialize(); - void LoadUnicodeMap(); + void LoadUnicodeMap() const; // logically const only. void LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_ByteString*& pCharNames, @@ -115,8 +115,8 @@ class CPDF_Font { CFX_ByteString m_BaseFont; CPDF_StreamAcc* m_pFontFile; CPDF_Dictionary* m_pFontDict; - CPDF_ToUnicodeMap* m_pToUnicodeMap; - FX_BOOL m_bToUnicodeLoaded; + mutable CPDF_ToUnicodeMap* m_pToUnicodeMap; + mutable FX_BOOL m_bToUnicodeLoaded; int m_Flags; FX_RECT m_FontBBox; int m_StemV; |