Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: fpdfsdk/src/fpdfsave.cpp

Issue 1395493007: Introduce CPDF_Document::FromFPDFDocument(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdfppo.cpp ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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*)document; 59 CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfppo.cpp ('k') | fpdfsdk/src/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698