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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp

Issue 1264423003: FPDF_Creator can only create file through embedder-supplied callback. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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 | « core/include/fxcrt/fx_stream.h ('k') | core/src/fxcrt/fx_basic_buffer.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 "../../../include/fxcrt/fx_ext.h" 7 #include "../../../include/fxcrt/fx_ext.h"
8 #include "../../../include/fpdfapi/fpdf_serial.h" 8 #include "../../../include/fpdfapi/fpdf_serial.h"
9 #include "editint.h" 9 #include "editint.h"
10 10
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 void CPDF_Creator::Clear() { 2009 void CPDF_Creator::Clear() {
2010 delete m_pXRefStream; 2010 delete m_pXRefStream;
2011 m_pXRefStream = NULL; 2011 m_pXRefStream = NULL;
2012 m_File.Clear(); 2012 m_File.Clear();
2013 m_NewObjNumArray.RemoveAll(); 2013 m_NewObjNumArray.RemoveAll();
2014 if (m_pIDArray) { 2014 if (m_pIDArray) {
2015 m_pIDArray->Release(); 2015 m_pIDArray->Release();
2016 m_pIDArray = NULL; 2016 m_pIDArray = NULL;
2017 } 2017 }
2018 } 2018 }
2019 FX_BOOL CPDF_Creator::Create(const FX_CHAR* filename, FX_DWORD flags) {
2020 if (!m_File.AttachFile(filename)) {
2021 return FALSE;
2022 }
2023 FX_BOOL bRet = Create(flags);
2024 if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
2025 Clear();
2026 }
2027 return bRet;
2028 }
2029 FX_BOOL CPDF_Creator::Create(const FX_WCHAR* filename, FX_DWORD flags) {
2030 if (!m_File.AttachFile(filename)) {
2031 return FALSE;
2032 }
2033 FX_BOOL bRet = Create(flags);
2034 if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
2035 Clear();
2036 }
2037 return bRet;
2038 }
2039 FX_BOOL CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags) { 2019 FX_BOOL CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags) {
2040 if (!pFile) { 2020 if (!pFile) {
2041 return FALSE; 2021 return FALSE;
2042 } 2022 }
2043 if (!m_File.AttachFile(pFile, FALSE)) { 2023 if (!m_File.AttachFile(pFile, FALSE)) {
2044 return FALSE; 2024 return FALSE;
2045 } 2025 }
2046 return Create(flags); 2026 return Create(flags);
2047 } 2027 }
2048 FX_BOOL CPDF_Creator::Create(FX_DWORD flags) { 2028 FX_BOOL CPDF_Creator::Create(FX_DWORD flags) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 m_bNewCrypto = FALSE; 2139 m_bNewCrypto = FALSE;
2160 if (!m_bStandardSecurity) { 2140 if (!m_bStandardSecurity) {
2161 return; 2141 return;
2162 } 2142 }
2163 if (m_pEncryptDict) { 2143 if (m_pEncryptDict) {
2164 m_pEncryptDict->Release(); 2144 m_pEncryptDict->Release();
2165 m_pEncryptDict = NULL; 2145 m_pEncryptDict = NULL;
2166 } 2146 }
2167 m_bStandardSecurity = FALSE; 2147 m_bStandardSecurity = FALSE;
2168 } 2148 }
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_stream.h ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698