diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-26 13:20:26 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-26 13:20:26 -0800 |
commit | 8e5cd19d174f259bfda5f7a9699b08fdc4289b56 (patch) | |
tree | 6c2382c4cfe0475ecbfafc1af981dcaa0a801c35 /fpdfsdk/src/fpdfsave.cpp | |
parent | d834d55f902ccd18cba85f93ecf51e30c5e7e47b (diff) | |
download | pdfium-8e5cd19d174f259bfda5f7a9699b08fdc4289b56.tar.xz |
Merge to XFA: War on #defines, part 1.
Contains additional XFA-specific changes.
Original Review URL: https://codereview.chromium.org/1632143002 .
(cherry picked from commit 66a9dc9dd65ed2b9c7ede448d046b770140f16d5)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1636503006 .
Diffstat (limited to 'fpdfsdk/src/fpdfsave.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfsave.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index c1d21c8f72..c8bf5e767d 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -93,7 +93,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CPDF_Object* pXFA = pAcroForm->GetElement("XFA"); if (pXFA == NULL) return TRUE; - if (pXFA->GetType() != PDFOBJ_ARRAY) + if (!pXFA->IsArray()) return FALSE; CPDF_Array* pArray = pXFA->GetArray(); if (NULL == pArray) @@ -105,7 +105,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, int iLast = size - 2; for (int i = 0; i < size - 1; i++) { CPDF_Object* pPDFObj = pArray->GetElement(i); - if (pPDFObj->GetType() != PDFOBJ_STRING) + if (!pPDFObj->IsString()) continue; if (pPDFObj->GetString() == "form") iFormIndex = i + 1; @@ -136,13 +136,12 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, if (iFormIndex != -1) { // Get form CPDF_Stream CPDF_Object* pFormPDFObj = pArray->GetElement(iFormIndex); - if (pFormPDFObj->GetType() == PDFOBJ_REFERENCE) { - CPDF_Object* pFormDircetObj = pFormPDFObj->GetDirect(); - if (NULL != pFormDircetObj && - pFormDircetObj->GetType() == PDFOBJ_STREAM) { - pFormStream = (CPDF_Stream*)pFormDircetObj; + if (pFormPDFObj->IsReference()) { + CPDF_Object* pFormDirectObj = pFormPDFObj->GetDirect(); + if (pFormDirectObj && pFormDirectObj->IsStream()) { + pFormStream = (CPDF_Stream*)pFormDirectObj; } - } else if (pFormPDFObj->GetType() == PDFOBJ_STREAM) { + } else if (pFormPDFObj->IsStream()) { pFormStream = (CPDF_Stream*)pFormPDFObj; } } @@ -150,14 +149,13 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, if (iDataSetsIndex != -1) { // Get datasets CPDF_Stream CPDF_Object* pDataSetsPDFObj = pArray->GetElement(iDataSetsIndex); - if (pDataSetsPDFObj->GetType() == PDFOBJ_REFERENCE) { + if (pDataSetsPDFObj->IsReference()) { CPDF_Reference* pDataSetsRefObj = (CPDF_Reference*)pDataSetsPDFObj; - CPDF_Object* pDataSetsDircetObj = pDataSetsRefObj->GetDirect(); - if (NULL != pDataSetsDircetObj && - pDataSetsDircetObj->GetType() == PDFOBJ_STREAM) { - pDataSetsStream = (CPDF_Stream*)pDataSetsDircetObj; + CPDF_Object* pDataSetsDirectObj = pDataSetsRefObj->GetDirect(); + if (pDataSetsDirectObj && pDataSetsDirectObj->IsStream()) { + pDataSetsStream = (CPDF_Stream*)pDataSetsDirectObj; } - } else if (pDataSetsPDFObj->GetType() == PDFOBJ_STREAM) { + } else if (pDataSetsPDFObj->IsStream()) { pDataSetsStream = (CPDF_Stream*)pDataSetsPDFObj; } } |