Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp

Issue 2044293004: Convert CFXJSE_Value::ToString to return. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fm2jscontext_cleanup_9
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp ('k') | xfa/fxjse/value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index 1a3ef8f15109d061e324ce42d142f923409620d8..ef2bafb81eaf9b468393ea77b26e8d603f7526f3 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -163,10 +163,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
if (bSetting) {
- CFX_ByteString bsValue;
- pValue->ToString(bsValue);
- pNotify->GetDocProvider()->SetTitle(
- hDoc, CFX_WideString::FromUTF8(bsValue.AsStringC()));
+ pNotify->GetDocProvider()->SetTitle(hDoc, pValue->ToWideString());
return;
}
CFX_WideString wsTitle;
@@ -314,10 +311,6 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
if (pValue->IsObject()) {
pNode = ToNode(pValue.get(), nullptr);
} else if (pValue->IsString()) {
- CFX_ByteString bsString;
- pValue->ToString(bsString);
- CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString.AsStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext)
return;
@@ -330,7 +323,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
int32_t iRet = pScriptContext->ResolveObjects(
- pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag);
+ pObject, pValue->ToWideString().AsStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode())
return;
@@ -509,10 +502,6 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
if (pValue->IsObject()) {
pNode = ToNode(pValue.get(), nullptr);
} else if (pValue->IsString()) {
- CFX_ByteString bsString;
- pValue->ToString(bsString);
- CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString.AsStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext)
return;
@@ -525,7 +514,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
int32_t iRet = pScriptContext->ResolveObjects(
- pObject, wsExpression.AsStringC(), resoveNodeRS, dwFlag);
+ pObject, pValue->ToWideString().AsStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode())
return;
@@ -613,9 +602,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(
if (pValueArg->IsNull()) {
wsValue = FX_WSTRC(L"");
} else {
- CFX_ByteString byMessage;
- pValueArg->ToString(byMessage);
- wsValue = CFX_WideString::FromUTF8(byMessage.AsStringC());
+ wsValue = pValueArg->ToWideString();
}
return TRUE;
}
« no previous file with comments | « xfa/fxfa/parser/xfa_script_eventpseudomodel.cpp ('k') | xfa/fxjse/value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698