summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_flatten.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-22 16:45:48 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-22 16:45:48 -0400
commitaa435ba7fe0aacd9102e8c73311c5382ca112439 (patch)
treed37573646c6135126d3971358024a70ee222fb21 /fpdfsdk/src/fpdf_flatten.cpp
parent2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (diff)
downloadpdfium-aa435ba7fe0aacd9102e8c73311c5382ca112439.tar.xz
Merge to XFA: Add type cast definitions for CPDF_Stream.
This Cl adds ToStream, CPDF_Object::AsStream and CPDF_Object::IsStream and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1402413004 . (cherry picked from commit 338805f1366dcdf9a5b48cf591541cf98d7490f1) Review URL: https://codereview.chromium.org/1422513004 .
Diffstat (limited to 'fpdfsdk/src/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index f4d49ce182..39441c4aef 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;