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 /core/src/fpdfapi/fpdf_edit | |
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 'core/src/fpdfapi/fpdf_edit')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index fec4e4f8e1..16124a3c38 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -61,12 +61,16 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, break; } case PDFOBJ_REFERENCE: { - if (pFile->AppendString(FX_BSTRC(" ")) < 0) + if (pFile->AppendString(FX_BSTRC(" ")) < 0) { return -1; - if ((len = pFile->AppendDWord(pObj->AsReference()->GetRefObjNum())) < 0) + } + CPDF_Reference* p = (CPDF_Reference*)pObj; + if ((len = pFile->AppendDWord(p->GetRefObjNum())) < 0) { return -1; - if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) + } + if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) { return -1; + } offset += len + 6; break; } @@ -1164,12 +1168,16 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, break; } case PDFOBJ_REFERENCE: { - if (m_File.AppendString(FX_BSTRC(" ")) < 0) + if (m_File.AppendString(FX_BSTRC(" ")) < 0) { return -1; - if ((len = m_File.AppendDWord(pObj->AsReference()->GetRefObjNum())) < 0) + } + CPDF_Reference* p = (CPDF_Reference*)pObj; + if ((len = m_File.AppendDWord(p->GetRefObjNum())) < 0) { return -1; - if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) + } + if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) { return -1; + } m_Offset += len + 5; break; } |