summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
commit2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (patch)
treee25b2ba13112f4ead789260ee57fe5b40c13b83e /core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
parentbc6c6723c37772b02de9e6e43fa0fd9439874905 (diff)
downloadpdfium-2b11dc1220746d2f6f97a940fc9e4235c8ed4975.tar.xz
Merge to XFA: Add type cast definitions for CPDF_Array.
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893003 . (cherry picked from commit c2bfc000e502c42c9a3017038fd9104c7997d126) Review URL: https://codereview.chromium.org/1419643005 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 79b4bba162..fecd6da9b2 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -482,8 +482,7 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources,
m_bDoBpcCheck = FALSE;
return TRUE;
}
- } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFilter;
+ } else if (CPDF_Array* pArray = pFilter->AsArray()) {
if (pArray->GetString(pArray->GetCount() - 1) ==
FX_BSTRC("JPXDecode")) {
m_bDoBpcCheck = FALSE;
@@ -570,8 +569,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode,
if (pMask == NULL) {
return pCompData;
}
- if (pMask->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pMask;
+ if (CPDF_Array* pArray = pMask->AsArray()) {
if (pArray->GetCount() >= m_nComponents * 2) {
for (FX_DWORD i = 0; i < m_nComponents; i++) {
int min_num = pArray->GetInteger(i * 2);
@@ -953,8 +951,7 @@ void CPDF_DIBSource::ValidateDictParam() {
} else if (filter == FX_BSTRC("DCTDecode")) {
m_bpc = 8;
}
- } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFilter;
+ } else if (CPDF_Array* pArray = pFilter->AsArray()) {
if (pArray->GetString(pArray->GetCount() - 1) ==
FX_BSTRC("CCITTFaxDecode") ||
pArray->GetString(pArray->GetCount() - 1) ==