diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-02 17:17:02 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-03 19:54:37 +0000 |
commit | c8fd3318a8deca3e1eabd6f7a9449ae4a0fa964d (patch) | |
tree | a5aedd888a3981f53722b7d65ea969d246f267c8 /xfa/fxfa/parser/cscript_hostpseudomodel.cpp | |
parent | db194cf018069b930d0e3d5fc0242e14f70e8620 (diff) | |
download | pdfium-c8fd3318a8deca3e1eabd6f7a9449ae4a0fa964d.tar.xz |
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 <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cscript_hostpseudomodel.cpp')
-rw-r--r-- | xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
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) { |