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_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 #define XFA_DATASETS 0 | 61 #define XFA_DATASETS 0 |
62 #define XFA_FORMS 1 | 62 #define XFA_FORMS 1 |
63 | 63 |
64 FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList
) | 64 FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList
) |
65 { | 65 { |
66 if (!pDocument) | 66 if (!pDocument) |
67 return FALSE; | 67 return FALSE; |
68 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA && pDocument->GetDocT
ype() != DOCTYPE_STATIC_XFA) | 68 if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA && pDocument->GetDocT
ype() != DOCTYPE_STATIC_XFA) |
69 return TRUE; | 69 return TRUE; |
70 » if (!FPDFXFA_GetApp()->GetXFAApp()) | 70 » if (!CPDFXFA_App::GetInstance()->GetXFAApp()) |
71 return TRUE; | 71 return TRUE; |
72 | 72 |
73 IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); | 73 IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); |
74 if (NULL == pXFADocView) | 74 if (NULL == pXFADocView) |
75 return TRUE; | 75 return TRUE; |
76 » IXFA_DocHandler *pXFADocHandler = FPDFXFA_GetApp()->GetXFAApp()->GetDocH
andler(); | 76 |
77 » | 77 » IXFA_DocHandler *pXFADocHandler = CPDFXFA_App::GetInstance()->GetXFAApp(
)->GetDocHandler(); |
78 CPDF_Document * pPDFDocument = pDocument->GetPDFDoc(); | 78 CPDF_Document * pPDFDocument = pDocument->GetPDFDoc(); |
79 » if (pDocument == NULL) | 79 » if (pDocument == NULL) |
80 return FALSE; | 80 return FALSE; |
| 81 |
81 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); | 82 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); |
82 if (pRoot == NULL) | 83 if (pRoot == NULL) |
83 return FALSE; | 84 return FALSE; |
84 CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm"); | 85 CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm"); |
85 if (NULL == pAcroForm) | 86 if (NULL == pAcroForm) |
86 return FALSE; | 87 return FALSE; |
87 CPDF_Object* pXFA = pAcroForm->GetElement("XFA"); | 88 CPDF_Object* pXFA = pAcroForm->GetElement("XFA"); |
88 if (pXFA == NULL) | 89 if (pXFA == NULL) |
89 return TRUE; | 90 return TRUE; |
90 if(pXFA->GetType() != PDFOBJ_ARRAY) | 91 if(pXFA->GetType() != PDFOBJ_ARRAY) |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 { | 351 { |
351 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0); | 352 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0); |
352 } | 353 } |
353 | 354 |
354 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,F
PDF_FILEWRITE * pFileWrite, | 355 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,F
PDF_FILEWRITE * pFileWrite, |
355 FPDF_DWORD flags, int fileVersion) | 356 FPDF_DWORD flags, int fileVersion) |
356 { | 357 { |
357 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion); | 358 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion); |
358 } | 359 } |
359 | 360 |
OLD | NEW |