summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp9
3 files changed, 5 insertions, 10 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index cb5450f913..ccc8ce63cf 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -1224,9 +1224,8 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) {
CPDF_Function* pFuncs[3] = {nullptr, nullptr, nullptr};
FX_BOOL bUniTransfer = TRUE;
FX_BOOL bIdentity = TRUE;
- if (pObj->GetType() == PDFOBJ_ARRAY) {
+ if (CPDF_Array* pArray = pObj->AsArray()) {
bUniTransfer = FALSE;
- CPDF_Array* pArray = (CPDF_Array*)pObj;
if (pArray->GetCount() < 3)
return nullptr;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index cdf2104f82..2754223f3e 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -412,8 +412,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
bsDecodeType == FX_BSTRC("JPXDecode")) {
m_Flags |= FXRENDER_IMAGE_LOSSY;
}
- } else if (pFilters->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFilters;
+ } else if (CPDF_Array* pArray = pFilters->AsArray()) {
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
CFX_ByteStringC bsDecodeType = pArray->GetConstString(i);
if (bsDecodeType == FX_BSTRC("DCTDecode") ||
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) ==