diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2015-10-26 13:02:07 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2015-10-26 13:02:07 -0400 |
commit | 7e155865c90cc1115cc7193b7646a341d8f9093e (patch) | |
tree | 44e4351192f0af909671df95a1aac16a1609f750 /fpdfsdk/src/fpdf_transformpage.cpp | |
parent | 9024e026dae1af064b8467bb0f62278417fb82d1 (diff) | |
download | pdfium-7e155865c90cc1115cc7193b7646a341d8f9093e.tar.xz |
Revert "Add type cast definitions for CPDF_Reference."
This is causing pixel test failures on the bots.
FAILURE: bug_543018_2.in
FAILURE: bug_543018_1.in
FAILURE: bug_524043_1.in
This reverts commit 9024e026dae1af064b8467bb0f62278417fb82d1.
Add type cast definitions for CPDF_Reference.
This Cl adds ToReference, CPDF_Object::AsReference and CPDF_Object::IsReference
and updates the src to use them as needed.
BUG=pdfium:201
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1420973002 .
Review URL: https://codereview.chromium.org/1414393006 .
Diffstat (limited to 'fpdfsdk/src/fpdf_transformpage.cpp')
-rw-r--r-- | fpdfsdk/src/fpdf_transformpage.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp index 8a835fb220..20713fe07d 100644 --- a/fpdfsdk/src/fpdf_transformpage.cpp +++ b/fpdfsdk/src/fpdf_transformpage.cpp @@ -135,7 +135,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); pContentArray->AddReference(pDoc, pEndStream); - } else if (CPDF_Reference* pReference = ToReference(pContentObj)) { + } else if (pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE) { + CPDF_Reference* pReference = (CPDF_Reference*)pContentObj; CPDF_Object* pDirectObj = pReference->GetDirect(); if (pDirectObj) { if (CPDF_Array* pArray = pDirectObj->AsArray()) { @@ -164,7 +165,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, CPDF_Dictionary* pDict = nullptr; CFX_ByteString key; CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key); - if (pObj->IsReference()) + if (pObj->GetType() == PDFOBJ_REFERENCE) pObj = pObj->GetDirect(); if (pObj->IsDictionary()) @@ -305,7 +306,8 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, pContentArray = pArray; CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); - } else if (CPDF_Reference* pReference = ToReference(pContentObj)) { + } else if (pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE) { + CPDF_Reference* pReference = (CPDF_Reference*)pContentObj; CPDF_Object* pDirectObj = pReference->GetDirect(); if (pDirectObj) { if (CPDF_Array* pArray = pDirectObj->AsArray()) { |