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

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

Issue 1868293002: Make converstion explicit from CFX_ByteString to uint8_t* (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | core/fpdfapi/fpdf_page/cpdf_colorspace.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 "core/fpdfapi/fpdf_edit/editint.h" 7 #include "core/fpdfapi/fpdf_edit/editint.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 CFX_ByteStringC bsBuffer(buffer.data(), buffer.size()); 2004 CFX_ByteStringC bsBuffer(buffer.data(), buffer.size());
2005 m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument); 2005 m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument);
2006 return; 2006 return;
2007 } 2007 }
2008 m_pIDArray->Add(m_pIDArray->GetObjectAt(0)->Clone()); 2008 m_pIDArray->Add(m_pIDArray->GetObjectAt(0)->Clone());
2009 if (m_pEncryptDict && !pOldIDArray && m_pParser && bNewId) { 2009 if (m_pEncryptDict && !pOldIDArray && m_pParser && bNewId) {
2010 if (m_pEncryptDict->GetStringBy("Filter") == "Standard") { 2010 if (m_pEncryptDict->GetStringBy("Filter") == "Standard") {
2011 CPDF_StandardSecurityHandler handler; 2011 CPDF_StandardSecurityHandler handler;
2012 CFX_ByteString user_pass = m_pParser->GetPassword(); 2012 CFX_ByteString user_pass = m_pParser->GetPassword();
2013 uint32_t flag = PDF_ENCRYPT_CONTENT; 2013 uint32_t flag = PDF_ENCRYPT_CONTENT;
2014 handler.OnCreate(m_pEncryptDict, m_pIDArray, (const uint8_t*)user_pass, 2014 handler.OnCreate(m_pEncryptDict, m_pIDArray, user_pass.raw_str(),
2015 user_pass.GetLength(), flag); 2015 user_pass.GetLength(), flag);
2016 if (m_bNewCrypto) { 2016 if (m_bNewCrypto) {
2017 delete m_pCryptoHandler; 2017 delete m_pCryptoHandler;
2018 } 2018 }
2019 m_pCryptoHandler = new CPDF_StandardCryptoHandler; 2019 m_pCryptoHandler = new CPDF_StandardCryptoHandler;
2020 m_pCryptoHandler->Init(m_pEncryptDict, &handler); 2020 m_pCryptoHandler->Init(m_pEncryptDict, &handler);
2021 m_bNewCrypto = TRUE; 2021 m_bNewCrypto = TRUE;
2022 m_bSecurityChanged = TRUE; 2022 m_bSecurityChanged = TRUE;
2023 } 2023 }
2024 } 2024 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 m_bNewCrypto = FALSE; 2070 m_bNewCrypto = FALSE;
2071 if (!m_bStandardSecurity) { 2071 if (!m_bStandardSecurity) {
2072 return; 2072 return;
2073 } 2073 }
2074 if (m_pEncryptDict) { 2074 if (m_pEncryptDict) {
2075 m_pEncryptDict->Release(); 2075 m_pEncryptDict->Release();
2076 m_pEncryptDict = NULL; 2076 m_pEncryptDict = NULL;
2077 } 2077 }
2078 m_bStandardSecurity = FALSE; 2078 m_bStandardSecurity = FALSE;
2079 } 2079 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_page/cpdf_colorspace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698