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

Side by Side Diff: fpdfsdk/src/fpdfsave.cpp

Issue 1399833002: Allow building of XFA branch without XFA (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Keep GN in sync. Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../public/fpdf_edit.h" 7 #include "../../public/fpdf_edit.h"
8 #include "../../public/fpdf_formfill.h" 8 #include "../../public/fpdf_formfill.h"
9 #include "../../public/fpdf_save.h" 9 #include "../../public/fpdf_save.h"
10 #include "../include/fsdk_define.h" 10 #include "../include/fsdk_define.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 void CFX_IFileWrite::Release() { 54 void CFX_IFileWrite::Release() {
55 delete this; 55 delete this;
56 } 56 }
57 57
58 #define XFA_DATASETS 0 58 #define XFA_DATASETS 0
59 #define XFA_FORMS 1 59 #define XFA_FORMS 1
60 60
61 FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, 61 FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument,
62 CFX_PtrArray& fileList) { 62 CFX_PtrArray& fileList) {
63 #ifdef PDF_ENABLE_XFA
63 if (!pDocument) 64 if (!pDocument)
64 return FALSE; 65 return FALSE;
65 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA && 66 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA &&
66 pDocument->GetDocType() != DOCTYPE_STATIC_XFA) 67 pDocument->GetDocType() != DOCTYPE_STATIC_XFA)
67 return TRUE; 68 return TRUE;
68 if (!CPDFXFA_App::GetInstance()->GetXFAApp()) 69 if (!CPDFXFA_App::GetInstance()->GetXFAApp())
69 return TRUE; 70 return TRUE;
70 71
71 IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); 72 IXFA_DocView* pXFADocView = pDocument->GetXFADocView();
72 if (NULL == pXFADocView) 73 if (NULL == pXFADocView)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 { 222 {
222 iLast = pArray->GetCount() - 2; 223 iLast = pArray->GetCount() - 2;
223 pArray->InsertAt(iLast, CPDF_String::Create("form")); 224 pArray->InsertAt(iLast, CPDF_String::Create("form"));
224 pArray->InsertAt(iLast + 1, pData, pPDFDocument); 225 pArray->InsertAt(iLast + 1, pData, pPDFDocument);
225 } 226 }
226 } 227 }
227 fileList.Add(pfileWrite); 228 fileList.Add(pfileWrite);
228 } 229 }
229 } 230 }
230 pContext->Release(); 231 pContext->Release();
232 #endif // PDF_ENABLE_XFA
233
231 return TRUE; 234 return TRUE;
232 } 235 }
233 236
234 FX_BOOL _SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) { 237 FX_BOOL _SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) {
235 if (!pDocument) 238 if (!pDocument)
236 return FALSE; 239 return FALSE;
237 240
238 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA && 241 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA &&
239 pDocument->GetDocType() != DOCTYPE_STATIC_XFA) 242 pDocument->GetDocType() != DOCTYPE_STATIC_XFA)
240 return TRUE; 243 return TRUE;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 FPDF_DWORD flags) { 336 FPDF_DWORD flags) {
334 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); 337 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0);
335 } 338 }
336 339
337 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, 340 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,
338 FPDF_FILEWRITE* pFileWrite, 341 FPDF_FILEWRITE* pFileWrite,
339 FPDF_DWORD flags, 342 FPDF_DWORD flags,
340 int fileVersion) { 343 int fileVersion) {
341 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); 344 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion);
342 } 345 }
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698