From 995a601c50874729ac40e2cc444b8894cf2aea96 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 20 Jun 2017 17:42:39 -0400 Subject: Cleanup fpdf_parser_decode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL fixes some nits in fpdf_parser_decode, especially avoiding non-const reference parameters. Change-Id: Ibb914850afd924bb398f886ac862f7589519ef7e Reviewed-on: https://pdfium-review.googlesource.com/6750 Commit-Queue: Nicolás Peña Reviewed-by: dsinclair --- core/fpdfdoc/cpdf_formfield.cpp | 3 +-- core/fpdfdoc/cpvt_generateap.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc') diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index cd47f269bc..acb46a5beb 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -662,8 +662,7 @@ int CPDF_FormField::InsertOption(CFX_WideString csOptLabel, if (bNotify && !NotifyListOrComboBoxBeforeChange(csOptLabel)) return -1; - CFX_ByteString csStr = - PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength()); + CFX_ByteString csStr = PDF_EncodeText(csOptLabel); CPDF_Array* pOpt = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt")); if (!pOpt) pOpt = m_pDict->SetNewFor("Opt"); diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index bcd3aa1d00..d542e8cb32 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -1348,7 +1348,7 @@ CFX_ByteString CPVT_GenerateAP::GetPDFWordString(IPVT_FontMap* pFontMap, CFX_ByteString CPVT_GenerateAP::GetWordRenderString( const CFX_ByteString& strWords) { if (strWords.GetLength() > 0) - return PDF_EncodeString(strWords) + " Tj\n"; + return PDF_EncodeString(strWords, false) + " Tj\n"; return ""; } -- cgit v1.2.3