From c8fd3318a8deca3e1eabd6f7a9449ae4a0fa964d Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 2 Jan 2017 17:17:02 -0500 Subject: Cleaning out params in CPDFXFA_Context This CL cleans up some of the out params in CPDFXFA_Context. In the process several of the strings returned by ::LoadString() are inlined in their call sites and the defines removed. BUG=pdfium:549 Change-Id: I41a7ceeba3962299eecd0cb714ddb03d28dbb0ea Reviewed-on: https://pdfium-review.googlesource.com/2134 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'xfa/fxfa/parser/cscript_hostpseudomodel.cpp') diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index 7493570bc2..b4559669b7 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -37,9 +37,8 @@ CScript_HostPseudoModel::~CScript_HostPseudoModel() {} void CScript_HostPseudoModel::LoadString(CFXJSE_Value* pValue, CXFA_FFNotify* pNotify, uint32_t dwFlag) { - CFX_WideString wsValue; - pNotify->GetAppProvider()->LoadString(dwFlag, wsValue); - pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->LoadString(dwFlag)).AsStringC()); } void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue, @@ -97,9 +96,8 @@ void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue, ThrowException(XFA_IDS_UNABLE_SET_LANGUAGE); return; } - CFX_WideString wsLanguage; - pNotify->GetAppProvider()->GetLanguage(wsLanguage); - pValue->SetString(FX_UTF8Encode(wsLanguage).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetLanguage()).AsStringC()); } void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue, @@ -128,9 +126,8 @@ void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue, ThrowException(XFA_IDS_UNABLE_SET_PLATFORM); return; } - CFX_WideString wsPlatform; - pNotify->GetAppProvider()->GetPlatform(wsPlatform); - pValue->SetString(FX_UTF8Encode(wsPlatform).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetPlatform()).AsStringC()); } void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue, bool bSetting, @@ -210,9 +207,8 @@ void CScript_HostPseudoModel::Name(CFXJSE_Value* pValue, ThrowException(XFA_IDS_INVAlID_PROP_SET); return; } - CFX_WideString wsAppName; - pNotify->GetAppProvider()->GetAppName(wsAppName); - pValue->SetString(FX_UTF8Encode(wsAppName).AsStringC()); + pValue->SetString( + FX_UTF8Encode(pNotify->GetAppProvider()->GetAppName()).AsStringC()); } void CScript_HostPseudoModel::GotoURL(CFXJSE_Arguments* pArguments) { -- cgit v1.2.3