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

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

Issue 1422513004: Merge to XFA: Add type cast definitions for CPDF_Stream. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 687e8e1d923b65c3865a384249a0c021c689e6e0..1b1ba8b0a44e32415f2bbaeda5c7a00aea5621d3 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