Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: core/fpdfapi/fpdf_font/cpdf_font.cpp

Issue 2045033002: Avoid const-cast in CPDF_Font (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Stray file. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/include/cpdf_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/cpdf_font.cpp
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp
index 78bdeeffaa63afab495d9eae8b93c8c5d7d7d65c..c15ac6b44557d23191c06c868e2d3381298a2f63 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) {
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/include/cpdf_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698