summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-05 12:22:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-05 12:22:15 -0700
commitfc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd (patch)
tree8662b886d373b149fbdd6f5db9570c233cb23ce7 /xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
parentc7a7349cf316af37d4ad4b71c5742159deccbf33 (diff)
downloadpdfium-fc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd.tar.xz
Make down-conversion explicit from CFX_Widetring to CFX_WideStringC.
Companion to https://codereview.chromium.org/1853233002 BUG= Review URL: https://codereview.chromium.org/1857073002
Diffstat (limited to 'xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index b7e3bb380c..08e9cede92 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -164,7 +164,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
CFX_ByteString bsValue;
FXJSE_Value_ToUTF8String(hValue, bsValue);
pNotify->GetDocProvider()->SetTitle(
- hDoc, CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()));
+ hDoc,
+ CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()).AsWideStringC());
return;
}
CFX_WideString wsTitle;
@@ -292,7 +293,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(
CFX_ByteString bsURL = pArguments->GetUTF8String(0);
wsURL = CFX_WideString::FromUTF8(bsURL, bsURL.GetLength());
}
- pNotify->GetDocProvider()->GotoURL(hDoc, wsURL);
+ pNotify->GetDocProvider()->GotoURL(hDoc, wsURL.AsWideStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
CFXJSE_Arguments* pArguments) {
@@ -331,8 +332,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression,
- resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(
+ pObject, wsExpression.AsWideStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
FXJSE_Value_Release(hValue);
return;
@@ -385,8 +386,9 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response(
bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
}
CFX_WideString wsAnswer;
- pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion, wsTitle,
- wsDefaultAnswer, bMark);
+ pNotify->GetAppProvider()->Response(wsAnswer, wsQuestion.AsWideStringC(),
+ wsTitle.AsWideStringC(),
+ wsDefaultAnswer.AsWideStringC(), bMark);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsAnswer).AsByteStringC());
@@ -454,7 +456,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(
CXFA_Node* pNode = NULL;
int32_t iExpLength = wsExpression.GetLength();
while (iStart < iExpLength) {
- iStart = XFA_FilterName(wsExpression, iStart, wsName);
+ iStart = XFA_FilterName(wsExpression.AsWideStringC(), iStart, wsName);
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
return;
@@ -466,8 +468,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- int32_t iRet =
- pScriptContext->ResolveObjects(pObject, wsName, resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(
+ pObject, wsName.AsWideStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
continue;
}
@@ -535,8 +537,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
XFA_RESOLVENODE_Siblings;
XFA_RESOLVENODE_RS resoveNodeRS;
- int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression,
- resoveNodeRS, dwFlag);
+ int32_t iRet = pScriptContext->ResolveObjects(
+ pObject, wsExpression.AsWideStringC(), resoveNodeRS, dwFlag);
if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) {
FXJSE_Value_Release(hValue);
return;
@@ -601,7 +603,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(
}
}
int32_t iValue = pNotify->GetAppProvider()->MsgBox(
- wsMessage, bsTitle, dwMessageType, dwButtonType);
+ wsMessage.AsWideStringC(), bsTitle.AsWideStringC(), dwMessageType,
+ dwButtonType);
FXJSE_HVALUE hValue = pArguments->GetReturnValue();
if (hValue) {
FXJSE_Value_SetInteger(hValue, iValue);
@@ -733,7 +736,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(
wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
- pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath);
+ pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath.AsWideStringC());
}
void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(
CFXJSE_Arguments* pArguments) {
@@ -756,7 +759,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(
if (iLength >= 2) {
bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
}
- pNotify->GetDocProvider()->ExportData(hDoc, wsFilePath, bXDP);
+ pNotify->GetDocProvider()->ExportData(hDoc, wsFilePath.AsWideStringC(), bXDP);
}
void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp(
CFXJSE_Arguments* pArguments) {