From aee28693976cc246eea8230a999906802e52cab7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Nov 2017 21:19:44 +0000 Subject: Cleanup XFA default value code This CL adds helper methods to CXFA_Node to retrieve the default values for attributes with the correct data types. Change-Id: I644435b4b430819f1060a95fa4fffe4ba2826cfe Reviewed-on: https://pdfium-review.googlesource.com/18450 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 72b8970022..374fe566fc 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -904,16 +904,15 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, if (!pFormFillEnv) return false; - WideStringView csURLC; - submitData.GetSubmitTarget(csURLC); - WideString csURL(csURLC); + WideString csURL; + submitData.GetSubmitTarget(csURL); if (csURL.IsEmpty()) { WideString ws; ws.FromLocal("Submit cancelled."); ByteString bs = ws.UTF16LE_Encode(); int len = bs.GetLength(); - pFormFillEnv->Alert((FPDF_WIDESTRING)bs.GetBuffer(len), - (FPDF_WIDESTRING)L"", 0, 4); + pFormFillEnv->Alert(reinterpret_cast(bs.GetBuffer(len)), + reinterpret_cast(L""), 0, 4); bs.ReleaseBuffer(len); return false; } @@ -922,10 +921,8 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, int fileFlag = -1; switch (submitData.GetSubmitFormat()) { case XFA_ATTRIBUTEENUM_Xdp: { - WideStringView csContentC; - submitData.GetSubmitXDPContent(csContentC); WideString csContent; - csContent = csContentC; + submitData.GetSubmitXDPContent(csContent); csContent.TrimLeft(); csContent.TrimRight(); WideString space; -- cgit v1.2.3