OLD | NEW |
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_save.h" | 7 #include "public/fpdf_save.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #ifdef PDF_ENABLE_XFA | 78 #ifdef PDF_ENABLE_XFA |
79 bool SaveXFADocumentData(CPDFXFA_Document* pDocument, | 79 bool SaveXFADocumentData(CPDFXFA_Document* pDocument, |
80 std::vector<ScopedFileStream>* fileList) { | 80 std::vector<ScopedFileStream>* fileList) { |
81 if (!pDocument) | 81 if (!pDocument) |
82 return false; | 82 return false; |
83 | 83 |
84 if (pDocument->GetDocType() != DOCTYPE_DYNAMIC_XFA && | 84 if (pDocument->GetDocType() != DOCTYPE_DYNAMIC_XFA && |
85 pDocument->GetDocType() != DOCTYPE_STATIC_XFA) | 85 pDocument->GetDocType() != DOCTYPE_STATIC_XFA) |
86 return true; | 86 return true; |
87 | 87 |
88 if (!CPDFXFA_App::GetInstance()->GetXFAApp()) | |
89 return true; | |
90 | |
91 CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView(); | 88 CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView(); |
92 if (!pXFADocView) | 89 if (!pXFADocView) |
93 return true; | 90 return true; |
94 | 91 |
95 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); | 92 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); |
96 if (!pDocument) | 93 if (!pDocument) |
97 return false; | 94 return false; |
98 | 95 |
99 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); | 96 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); |
100 if (!pRoot) | 97 if (!pRoot) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 FPDF_DWORD flags) { | 311 FPDF_DWORD flags) { |
315 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); | 312 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); |
316 } | 313 } |
317 | 314 |
318 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, | 315 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, |
319 FPDF_FILEWRITE* pFileWrite, | 316 FPDF_FILEWRITE* pFileWrite, |
320 FPDF_DWORD flags, | 317 FPDF_DWORD flags, |
321 int fileVersion) { | 318 int fileVersion) { |
322 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); | 319 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); |
323 } | 320 } |
OLD | NEW |