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

Unified Diff: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 1402413004: Add type cast definitions for CPDF_Stream. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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
Index: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 8972201b660df94b5f605b5b4d7e651c9f3639b5..02f0933f360089f2677ae74ed1e2664466a0b51a 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -1215,9 +1215,8 @@ FX_BOOL CPDF_CIDFont::_Load() {
->GetPageModule()
->GetFontGlobals()
->m_CMapManager.GetPredefinedCMap(cmap, m_pFontFile && m_bType1);
- } else if (pEncoding->GetType() == PDFOBJ_STREAM) {
+ } else if (CPDF_Stream* pStream = pEncoding->AsStream()) {
m_pAllocatedCMap = m_pCMap = new CPDF_CMap;
- CPDF_Stream* pStream = (CPDF_Stream*)pEncoding;
CPDF_StreamAcc acc;
acc.LoadAllData(pStream, FALSE);
m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());
@@ -1265,9 +1264,9 @@ FX_BOOL CPDF_CIDFont::_Load() {
CPDF_Object* pmap =
pCIDFontDict->GetElementValue(FX_BSTRC("CIDToGIDMap"));
if (pmap) {
- if (pmap->GetType() == PDFOBJ_STREAM) {
+ if (CPDF_Stream* pStream = pmap->AsStream()) {
m_pCIDToGIDMap = new CPDF_StreamAcc;
- m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE);
+ m_pCIDToGIDMap->LoadAllData(pStream, FALSE);
} else if (pmap->GetString() == FX_BSTRC("Identity")) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (m_pFontFile) {

Powered by Google App Engine
This is Rietveld 408576698