Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: fpdfsdk/src/fpdfsave.cpp

Issue 1636503006: Merge to XFA: War on #defines, part 1. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Dircet -> Direct typo. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfppo.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfsave.cpp
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index c1d21c8f72534bf1d62172e4b17800460e733994..c8bf5e767d96a1d57caf9ccc850e7c8e2b78491f 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;
}
}
« no previous file with comments | « fpdfsdk/src/fpdfppo.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698