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 |
88 CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView(); | 91 CXFA_FFDocView* pXFADocView = pDocument->GetXFADocView(); |
89 if (!pXFADocView) | 92 if (!pXFADocView) |
90 return true; | 93 return true; |
91 | 94 |
92 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); | 95 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); |
93 if (!pDocument) | 96 if (!pDocument) |
94 return false; | 97 return false; |
95 | 98 |
96 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); | 99 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); |
97 if (!pRoot) | 100 if (!pRoot) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 FPDF_DWORD flags) { | 314 FPDF_DWORD flags) { |
312 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); | 315 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); |
313 } | 316 } |
314 | 317 |
315 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, | 318 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, |
316 FPDF_FILEWRITE* pFileWrite, | 319 FPDF_FILEWRITE* pFileWrite, |
317 FPDF_DWORD flags, | 320 FPDF_DWORD flags, |
318 int fileVersion) { | 321 int fileVersion) { |
319 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); | 322 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); |
320 } | 323 } |
OLD | NEW |