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_save.h" | 8 #include "../../public/fpdf_save.h" |
9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void CFX_IFileWrite::Release() { | 50 void CFX_IFileWrite::Release() { |
51 delete this; | 51 delete this; |
52 } | 52 } |
53 | 53 |
54 FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document, | 54 FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document, |
55 FPDF_FILEWRITE* pFileWrite, | 55 FPDF_FILEWRITE* pFileWrite, |
56 FPDF_DWORD flags, | 56 FPDF_DWORD flags, |
57 FPDF_BOOL bSetVersion, | 57 FPDF_BOOL bSetVersion, |
58 int fileVerion) { | 58 int fileVerion) { |
59 CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); | 59 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
60 if (!pDoc) | 60 if (!pDoc) |
61 return 0; | 61 return 0; |
62 | 62 |
63 if (flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY) { | 63 if (flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY) { |
64 flags = 0; | 64 flags = 0; |
65 } | 65 } |
66 | 66 |
67 CPDF_Creator FileMaker(pDoc); | 67 CPDF_Creator FileMaker(pDoc); |
68 if (bSetVersion) | 68 if (bSetVersion) |
69 FileMaker.SetFileVersion(fileVerion); | 69 FileMaker.SetFileVersion(fileVerion); |
(...skipping 15 matching lines...) Expand all Loading... |
85 FPDF_DWORD flags) { | 85 FPDF_DWORD flags) { |
86 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); | 86 return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE, 0); |
87 } | 87 } |
88 | 88 |
89 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, | 89 DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document, |
90 FPDF_FILEWRITE* pFileWrite, | 90 FPDF_FILEWRITE* pFileWrite, |
91 FPDF_DWORD flags, | 91 FPDF_DWORD flags, |
92 int fileVersion) { | 92 int fileVersion) { |
93 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); | 93 return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE, fileVersion); |
94 } | 94 } |
OLD | NEW |