| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 std::unique_ptr<IXFA_ChecksumContext, ReleaseDeleter<IXFA_ChecksumContext>> | 131 std::unique_ptr<IXFA_ChecksumContext, ReleaseDeleter<IXFA_ChecksumContext>> |
| 132 pContext(XFA_Checksum_Create()); | 132 pContext(XFA_Checksum_Create()); |
| 133 pContext->StartChecksum(); | 133 pContext->StartChecksum(); |
| 134 | 134 |
| 135 // template | 135 // template |
| 136 if (iTemplate > -1) { | 136 if (iTemplate > -1) { |
| 137 CPDF_Stream* pTemplateStream = pArray->GetStreamAt(iTemplate); | 137 CPDF_Stream* pTemplateStream = pArray->GetStreamAt(iTemplate); |
| 138 CPDF_StreamAcc streamAcc; | 138 CPDF_StreamAcc streamAcc; |
| 139 streamAcc.LoadAllData(pTemplateStream); | 139 streamAcc.LoadAllData(pTemplateStream); |
| 140 uint8_t* pData = (uint8_t*)streamAcc.GetData(); | 140 uint8_t* pData = (uint8_t*)streamAcc.GetData(); |
| 141 FX_DWORD dwSize2 = streamAcc.GetSize(); | 141 uint32_t dwSize2 = streamAcc.GetSize(); |
| 142 ScopedFileStream pTemplate(FX_CreateMemoryStream(pData, dwSize2)); | 142 ScopedFileStream pTemplate(FX_CreateMemoryStream(pData, dwSize2)); |
| 143 pContext->UpdateChecksum(pTemplate.get()); | 143 pContext->UpdateChecksum(pTemplate.get()); |
| 144 } | 144 } |
| 145 CPDF_Stream* pFormStream = NULL; | 145 CPDF_Stream* pFormStream = NULL; |
| 146 CPDF_Stream* pDataSetsStream = NULL; | 146 CPDF_Stream* pDataSetsStream = NULL; |
| 147 if (iFormIndex != -1) { | 147 if (iFormIndex != -1) { |
| 148 // Get form CPDF_Stream | 148 // Get form CPDF_Stream |
| 149 CPDF_Object* pFormPDFObj = pArray->GetElement(iFormIndex); | 149 CPDF_Object* pFormPDFObj = pArray->GetElement(iFormIndex); |
| 150 if (pFormPDFObj->IsReference()) { | 150 if (pFormPDFObj->IsReference()) { |
| 151 CPDF_Object* pFormDirectObj = pFormPDFObj->GetDirect(); | 151 CPDF_Object* pFormDirectObj = pFormPDFObj->GetDirect(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 FPDF_DWORD flags) { | 320 FPDF_DWORD flags) { |
| 321 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); | 321 return FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); |
| 322 } | 322 } |
| 323 | 323 |
| 324 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, | 324 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, |
| 325 FPDF_FILEWRITE* pFileWrite, | 325 FPDF_FILEWRITE* pFileWrite, |
| 326 FPDF_DWORD flags, | 326 FPDF_DWORD flags, |
| 327 int fileVersion) { | 327 int fileVersion) { |
| 328 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); | 328 return FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); |
| 329 } | 329 } |
| OLD | NEW |