summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-06 10:51:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-06 10:51:14 -0700
commit6fe7d2174a47107578da912299c93b4dfb9f2add (patch)
tree4f2d343c477c9a4ec18d25801800eb08d8938dad /xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
parent89bdd0876e6b92c959839908204eb82337a27ba2 (diff)
downloadpdfium-6fe7d2174a47107578da912299c93b4dfb9f2add.tar.xz
Make CFX_WideString::FromUTF8() take a CFX_ByteStringC argument.
Methods that take string arguments and do not persist them should take *StringC types as argument rather than discrete ptr/len args. Avoids a number of implicit casts from CFX_ByteString to char*. BUG= Review URL: https://codereview.chromium.org/1861183002
Diffstat (limited to 'xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
index c71384e130..48edc73777 100644
--- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp
@@ -165,7 +165,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Title(
FXJSE_Value_ToUTF8String(hValue, bsValue);
pNotify->GetDocProvider()->SetTitle(
hDoc,
- CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()).AsWideStringC());
+ CFX_WideString::FromUTF8(bsValue.AsByteStringC()).AsWideStringC());
return;
}
CFX_WideString wsTitle;
@@ -291,7 +291,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(
CFX_WideString wsURL;
if (iLength >= 1) {
CFX_ByteString bsURL = pArguments->GetUTF8String(0);
- wsURL = CFX_WideString::FromUTF8(bsURL, bsURL.GetLength());
+ wsURL = CFX_WideString::FromUTF8(bsURL.AsByteStringC());
}
pNotify->GetDocProvider()->GotoURL(hDoc, wsURL.AsWideStringC());
}
@@ -318,7 +318,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(hValue, bsString);
CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString, bsString.GetLength());
+ CFX_WideString::FromUTF8(bsString.AsByteStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
FXJSE_Value_Release(hValue);
@@ -371,16 +371,15 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Response(
FX_BOOL bMark = FALSE;
if (iLength >= 1) {
CFX_ByteString bsQuestion = pArguments->GetUTF8String(0);
- wsQuestion = CFX_WideString::FromUTF8(bsQuestion, bsQuestion.GetLength());
+ wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsByteStringC());
}
if (iLength >= 2) {
CFX_ByteString bsTitle = pArguments->GetUTF8String(1);
- wsTitle = CFX_WideString::FromUTF8(bsTitle, bsTitle.GetLength());
+ wsTitle = CFX_WideString::FromUTF8(bsTitle.AsByteStringC());
}
if (iLength >= 3) {
CFX_ByteString bsDefaultAnswer = pArguments->GetUTF8String(2);
- wsDefaultAnswer =
- CFX_WideString::FromUTF8(bsDefaultAnswer, bsDefaultAnswer.GetLength());
+ wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsByteStringC());
}
if (iLength >= 4) {
bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
@@ -444,8 +443,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(
CFX_WideString wsExpression;
if (iLength >= 1) {
CFX_ByteString bsExpression = pArguments->GetUTF8String(0);
- wsExpression =
- CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength());
+ wsExpression = CFX_WideString::FromUTF8(bsExpression.AsByteStringC());
}
if (wsExpression.IsEmpty()) {
pNotify->ResetData();
@@ -523,7 +521,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(
CFX_ByteString bsString;
FXJSE_Value_ToUTF8String(hValue, bsString);
CFX_WideString wsExpression =
- CFX_WideString::FromUTF8(bsString, bsString.GetLength());
+ CFX_WideString::FromUTF8(bsString.AsByteStringC());
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext) {
FXJSE_Value_Release(hValue);
@@ -633,7 +631,7 @@ FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(
} else {
CFX_ByteString byMessage;
FXJSE_Value_ToUTF8String(hValueArg, byMessage);
- wsValue = CFX_WideString::FromUTF8(byMessage, byMessage.GetLength());
+ wsValue = CFX_WideString::FromUTF8(byMessage.AsByteStringC());
}
FXJSE_Value_Release(hValueArg);
return TRUE;
@@ -733,7 +731,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(
CFX_WideString wsFilePath;
if (iLength > 0) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
- wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
+ wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC());
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath.AsWideStringC());
@@ -754,7 +752,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(
FX_BOOL bXDP = TRUE;
if (iLength >= 1) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
- wsFilePath = CFX_WideString::FromUTF8(bsFilePath, bsFilePath.GetLength());
+ wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsByteStringC());
}
if (iLength >= 2) {
bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;