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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return true; | 93 return true; |
94 | 94 |
95 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); | 95 CPDF_Document* pPDFDocument = pDocument->GetPDFDoc(); |
96 if (!pDocument) | 96 if (!pDocument) |
97 return false; | 97 return false; |
98 | 98 |
99 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); | 99 CPDF_Dictionary* pRoot = pPDFDocument->GetRoot(); |
100 if (!pRoot) | 100 if (!pRoot) |
101 return false; | 101 return false; |
102 | 102 |
103 CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm"); | 103 CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm"); |
104 if (!pAcroForm) | 104 if (!pAcroForm) |
105 return false; | 105 return false; |
106 | 106 |
107 CPDF_Object* pXFA = pAcroForm->GetObjectBy("XFA"); | 107 CPDF_Object* pXFA = pAcroForm->GetObjectFor("XFA"); |
108 if (!pXFA) | 108 if (!pXFA) |
109 return true; | 109 return true; |
110 | 110 |
111 CPDF_Array* pArray = pXFA->AsArray(); | 111 CPDF_Array* pArray = pXFA->AsArray(); |
112 if (!pArray) | 112 if (!pArray) |
113 return false; | 113 return false; |
114 | 114 |
115 int size = pArray->GetCount(); | 115 int size = pArray->GetCount(); |
116 int iFormIndex = -1; | 116 int iFormIndex = -1; |
117 int iDataSetsIndex = -1; | 117 int iDataSetsIndex = -1; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 FPDF_DWORD flags) { | 308 FPDF_DWORD flags) { |
309 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); | 309 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); |
310 } | 310 } |
311 | 311 |
312 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, | 312 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, |
313 FPDF_FILEWRITE* pFileWrite, | 313 FPDF_FILEWRITE* pFileWrite, |
314 FPDF_DWORD flags, | 314 FPDF_DWORD flags, |
315 int fileVersion) { | 315 int fileVersion) { |
316 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); | 316 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); |
317 } | 317 } |
OLD | NEW |