summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_font/include
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-06-07 21:56:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 21:56:50 -0700
commita431e238ee42025cce44c3a76dd07c470d7f51ec (patch)
treedb9761e5b59b30df8d5cf91a283dcb6db58f75f2 /core/fpdfapi/fpdf_font/include
parentf27aeec59186e7d11a3a2167572617fd5ed42941 (diff)
downloadpdfium-a431e238ee42025cce44c3a76dd07c470d7f51ec.tar.xz
Avoid const-cast in CPDF_Font
Introduce a logically const initialization (via mutable members) so that this can happen lazily under const methods. Review-Url: https://codereview.chromium.org/2045033002
Diffstat (limited to 'core/fpdfapi/fpdf_font/include')
-rw-r--r--core/fpdfapi/fpdf_font/include/cpdf_font.h6
1 files changed, 3 insertions, 3 deletions
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;