diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-02-13 10:26:01 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-13 19:00:17 +0000 |
commit | f0b65545313f065790de7f91c02e5dd160753abd (patch) | |
tree | 747c55722c6b45a979d5c2894a259396a3189ed7 /xfa/fxfa/parser/cscript_hostpseudomodel.cpp | |
parent | 5fb0ad8adac5fcbf8c8f1965164f41d11c0af669 (diff) | |
download | pdfium-chromium/3012.tar.xz |
Simplify FX_UTF8Encode variants.chromium/3012
Doing so reveals places where there are needless copies
and conversions.
Change-Id: I24a868d40aa63836f4167eaf4541964049df7916
Reviewed-on: https://pdfium-review.googlesource.com/2555
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cscript_hostpseudomodel.cpp')
-rw-r--r-- | xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index eb8177ebf6..a06e02f56d 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -89,7 +89,7 @@ void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue, return; } pValue->SetString( - FX_UTF8Encode(pNotify->GetAppProvider()->GetLanguage()).AsStringC()); + pNotify->GetAppProvider()->GetLanguage().UTF8Encode().AsStringC()); } void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue, @@ -118,8 +118,9 @@ void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue, return; } pValue->SetString( - FX_UTF8Encode(pNotify->GetAppProvider()->GetPlatform()).AsStringC()); + pNotify->GetAppProvider()->GetPlatform().UTF8Encode().AsStringC()); } + void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute) { @@ -137,7 +138,7 @@ void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue, } CFX_WideString wsTitle; pNotify->GetDocEnvironment()->GetTitle(hDoc, wsTitle); - pValue->SetString(FX_UTF8Encode(wsTitle).AsStringC()); + pValue->SetString(wsTitle.UTF8Encode().AsStringC()); } void CScript_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue, @@ -199,7 +200,7 @@ void CScript_HostPseudoModel::Name(CFXJSE_Value* pValue, return; } pValue->SetString( - FX_UTF8Encode(pNotify->GetAppProvider()->GetAppName()).AsStringC()); + pNotify->GetAppProvider()->GetAppName().UTF8Encode().AsStringC()); } void CScript_HostPseudoModel::GotoURL(CFXJSE_Arguments* pArguments) { @@ -306,7 +307,7 @@ void CScript_HostPseudoModel::Response(CFXJSE_Arguments* pArguments) { wsQuestion, wsTitle, wsDefaultAnswer, bMark); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetString(FX_UTF8Encode(wsAnswer).AsStringC()); + pValue->SetString(wsAnswer.UTF8Encode().AsStringC()); } void CScript_HostPseudoModel::DocumentInBatch(CFXJSE_Arguments* pArguments) { @@ -674,7 +675,7 @@ void CScript_HostPseudoModel::CurrentDateTime(CFXJSE_Arguments* pArguments) { CFX_WideString wsDataTime = pNotify->GetCurrentDateTime(); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetString(FX_UTF8Encode(wsDataTime).AsStringC()); + pValue->SetString(wsDataTime.UTF8Encode().AsStringC()); } void CScript_HostPseudoModel::ThrowSetLanguageException() const { |