From c4a2b7518949df00651aa3513c93079f1968441e Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 7 Apr 2017 13:56:13 -0700 Subject: Cleanup string passing in core/fpdf* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return strings where possible. Add missing consts to strings passed by ref. Convert non-const cases to pointers. Rename a few methods to be clearer. Change-Id: I86569bc1744f539e6dd67fc73649b272c016328c Reviewed-on: https://pdfium-review.googlesource.com/3951 Commit-Queue: Tom Sepez Reviewed-by: Nicolás Peña --- core/fpdfapi/parser/cpdf_crypto_handler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_crypto_handler.cpp') diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.cpp b/core/fpdfapi/parser/cpdf_crypto_handler.cpp index 4fc7b3039b..ea09601b30 100644 --- a/core/fpdfapi/parser/cpdf_crypto_handler.cpp +++ b/core/fpdfapi/parser/cpdf_crypto_handler.cpp @@ -227,14 +227,14 @@ bool CPDF_CryptoHandler::CryptFinish(void* context, return true; } -void CPDF_CryptoHandler::Decrypt(uint32_t objnum, - uint32_t gennum, - CFX_ByteString& str) { +CFX_ByteString CPDF_CryptoHandler::Decrypt(uint32_t objnum, + uint32_t gennum, + const CFX_ByteString& str) { CFX_BinaryBuf dest_buf; void* context = DecryptStart(objnum, gennum); DecryptStream(context, str.raw_str(), str.GetLength(), dest_buf); DecryptFinish(context, dest_buf); - str = CFX_ByteString(dest_buf.GetBuffer(), dest_buf.GetSize()); + return CFX_ByteString(dest_buf.GetBuffer(), dest_buf.GetSize()); } void* CPDF_CryptoHandler::DecryptStart(uint32_t objnum, uint32_t gennum) { -- cgit v1.2.3