From ce6979f8d064507300fe0b3a856687fb958c9a5c Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 7 Dec 2017 22:19:53 +0000 Subject: Add WARN_UNUSED_RESULT to more static methods in (Byte|Wide)String. Also fixes some usages that were not working as intended after the conversion to static. Change-Id: I18c18369754f6ca165f98999b5b80eecf6c76973 Reviewed-on: https://pdfium-review.googlesource.com/20590 Reviewed-by: Lei Zhang Commit-Queue: Henrique Nakashima --- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 90431243a4..70b0f1b514 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -642,8 +642,7 @@ bool CPDFXFA_DocEnvironment::OnBeforeNotifySubmit() { if (!pFormFillEnv) return false; - WideString ws; - ws.FromLocal(IDS_XFA_Validate_Input); + WideString ws = WideString::FromLocal(IDS_XFA_Validate_Input); ByteString bs = ws.UTF16LE_Encode(); int len = bs.GetLength(); pFormFillEnv->Alert((FPDF_WIDESTRING)bs.GetBuffer(len), @@ -902,8 +901,7 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, WideString csURL = submitData.GetSubmitTarget(); if (csURL.IsEmpty()) { - WideString ws; - ws.FromLocal("Submit cancelled."); + WideString ws = WideString::FromLocal("Submit cancelled."); ByteString bs = ws.UTF16LE_Encode(); int len = bs.GetLength(); pFormFillEnv->Alert(reinterpret_cast(bs.GetBuffer(len)), @@ -919,8 +917,7 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, WideString csContent = submitData.GetSubmitXDPContent(); csContent.Trim(); - WideString space; - space.FromLocal(" "); + WideString space = WideString::FromLocal(" "); csContent = space + csContent + space; FPDF_DWORD flag = 0; if (submitData.IsSubmitEmbedPDF()) -- cgit v1.2.3