summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfsave.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-25 15:15:31 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-25 15:15:31 -0800
commit1b2462846b5deee5b142251cbe2bb7d7c07df41b (patch)
tree4338992c2fe5d005c0cbbd5d1a68b54eb3fe1709 /fpdfsdk/src/fpdfsave.cpp
parent5c4c193fd4b6dd0657abf5e74125f9887f91d720 (diff)
downloadpdfium-1b2462846b5deee5b142251cbe2bb7d7c07df41b.tar.xz
XFA: More underlying types
Precursor to https://codereview.chromium.org/1477583002/ Also: whitespace in fxjs_v8.h Merge where possible. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1472363003 .
Diffstat (limited to 'fpdfsdk/src/fpdfsave.cpp')
-rw-r--r--fpdfsdk/src/fpdfsave.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 882161c8fe..f643f704d7 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -284,16 +284,14 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,
FPDF_DWORD flags,
FPDF_BOOL bSetVersion,
int fileVerion) {
- CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document;
+ CPDF_Document* pPDFDoc = CPDFDocumentFromFPDFDocument(document);
+ if (!pPDFDoc)
+ return 0;
+ CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document;
CFX_PtrArray fileList;
-
_SendPreSaveToXFADoc(pDoc, fileList);
- CPDF_Document* pPDFDoc = pDoc->GetPDFDoc();
- if (!pPDFDoc)
- return 0;
-
if (flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY) {
flags = 0;
}
@@ -305,20 +303,18 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,
flags = 0;
FileMaker.RemoveSecurity();
}
+
CFX_IFileWrite* pStreamWrite = NULL;
FX_BOOL bRet;
pStreamWrite = new CFX_IFileWrite;
pStreamWrite->Init(pFileWrite);
bRet = FileMaker.Create(pStreamWrite, flags);
-
_SendPostSaveToXFADoc(pDoc);
-
for (int i = 0; i < fileList.GetSize(); i++) {
IFX_FileStream* pFile = (IFX_FileStream*)fileList.GetAt(i);
pFile->Release();
}
fileList.RemoveAll();
-
pStreamWrite->Release();
return bRet;
}