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

Unified Diff: fpdfsdk/src/fpdf_flatten.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: fpdfsdk/src/fpdf_flatten.cpp
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index f4d49ce1821ea32059b90cc4194a29f8e7214d64..39441c4aef00c7907d112d282d0915df379b7d4c 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -211,7 +211,7 @@ void SetPageContents(CFX_ByteString key,
switch (iType) {
case PDFOBJ_STREAM: {
pContentsArray = new CPDF_Array;
- CPDF_Stream* pContents = (CPDF_Stream*)pContentsObj;
+ CPDF_Stream* pContents = pContentsObj->AsStream();
FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContents);
CPDF_StreamAcc acc;
acc.LoadAllData(pContents);
@@ -447,15 +447,14 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
pFirstObj = pFirstObj->GetDirect();
- if (pFirstObj->GetType() != PDFOBJ_STREAM)
+ if (!pFirstObj->IsStream())
continue;
- pAPStream = (CPDF_Stream*)pFirstObj;
+ pAPStream = pFirstObj->AsStream();
}
}
}
}
-
if (!pAPStream)
continue;

Powered by Google App Engine
This is Rietveld 408576698