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

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

Issue 1857073002: Make down-conversion explicit from CFX_Widetring to CFX_WideStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: String argument type Created 4 years, 8 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_hostpseudomodel.cpp ('k') | xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_script_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index b85e9b783f5af55c32b207942a0d97a81f3708ca..fe6caa84bc38ee7e8c3ecf1058b42782d492b99c 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -124,8 +124,8 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject,
if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
pRefNode = ToNode(lpCurNode);
}
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName, hValue, dwFlag,
- TRUE)) {
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(),
+ hValue, dwFlag, TRUE)) {
return;
}
if (lpOrginalNode->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
@@ -198,13 +198,13 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject,
if (pOrginalObject->GetObjectType() == XFA_OBJECTTYPE_VariablesThis) {
pRefNode = ToNode(lpCurNode);
}
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName, hValue, dwFlag,
- FALSE)) {
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(),
+ hValue, dwFlag, FALSE)) {
return;
}
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
- if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName, hValue, dwFlag,
- FALSE)) {
+ if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsWideStringC(),
+ hValue, dwFlag, FALSE)) {
return;
}
CXFA_Object* pScriptObject =
@@ -243,8 +243,8 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject,
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes;
- FX_BOOL bRet = lpScriptContext->QueryNodeByFlag(ToNode(pObject), wsPropName,
- hValue, dwFlag, FALSE);
+ FX_BOOL bRet = lpScriptContext->QueryNodeByFlag(
+ ToNode(pObject), wsPropName.AsWideStringC(), hValue, dwFlag, FALSE);
if (bRet) {
return;
}
@@ -252,8 +252,8 @@ void CXFA_ScriptContext::NormalPropertyGetter(FXJSE_HOBJECT hObject,
(lpScriptContext->GetType() == XFA_SCRIPTLANGTYPE_Javascript &&
!lpScriptContext->IsStrictScopeInJavaScript())) {
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
- bRet = lpScriptContext->QueryNodeByFlag(ToNode(pObject), wsPropName, hValue,
- dwFlag, FALSE);
+ bRet = lpScriptContext->QueryNodeByFlag(
+ ToNode(pObject), wsPropName.AsWideStringC(), hValue, dwFlag, FALSE);
}
if (bRet) {
return;
@@ -281,8 +281,8 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject,
CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOrginalObject);
CFX_WideString wsPropName = CFX_WideString::FromUTF8(
(const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
- const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo =
- XFA_GetScriptAttributeByName(pObject->GetClassID(), wsPropName);
+ const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(
+ pObject->GetClassID(), wsPropName.AsWideStringC());
if (lpAttributeInfo) {
(pObject->*(lpAttributeInfo->lpfnCallback))(
hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
@@ -293,17 +293,18 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject,
}
CXFA_Node* pNode = ToNode(pObject);
CXFA_Node* pPropOrChild = NULL;
- const XFA_ELEMENTINFO* lpElementInfo = XFA_GetElementByName(wsPropName);
+ const XFA_ELEMENTINFO* lpElementInfo =
+ XFA_GetElementByName(wsPropName.AsWideStringC());
if (lpElementInfo) {
pPropOrChild = pNode->GetProperty(0, lpElementInfo->eName);
} else {
- pPropOrChild = pNode->GetFirstChildByName(wsPropName);
+ pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsWideStringC());
}
if (pPropOrChild) {
CFX_WideString wsDefaultName = FX_WSTRC(L"{default}");
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo =
XFA_GetScriptAttributeByName(pPropOrChild->GetClassID(),
- wsDefaultName);
+ wsDefaultName.AsWideStringC());
if (lpAttributeInfo) {
(pPropOrChild->*(lpAttributeInfo->lpfnCallback))(
hValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
@@ -333,10 +334,11 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter(
XFA_ELEMENT objElement = pObject->GetClassID();
CFX_WideString wsPropName = CFX_WideString::FromUTF8(
(const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
- if (XFA_GetMethodByName(objElement, wsPropName)) {
+ if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) {
return FXJSE_ClassPropType_Method;
}
- if (bQueryIn && !XFA_GetScriptAttributeByName(objElement, wsPropName)) {
+ if (bQueryIn &&
+ !XFA_GetScriptAttributeByName(objElement, wsPropName.AsWideStringC())) {
return FXJSE_ClassPropType_None;
}
return FXJSE_ClassPropType_Property;
@@ -355,7 +357,7 @@ int32_t CXFA_ScriptContext::GlobalPropTypeGetter(
XFA_ELEMENT objElement = pObject->GetClassID();
CFX_WideString wsPropName = CFX_WideString::FromUTF8(
(const FX_CHAR*)szPropName.raw_str(), szPropName.GetLength());
- if (XFA_GetMethodByName(objElement, wsPropName)) {
+ if (XFA_GetMethodByName(objElement, wsPropName.AsWideStringC())) {
return FXJSE_ClassPropType_Method;
}
return FXJSE_ClassPropType_Property;
@@ -373,7 +375,7 @@ void CXFA_ScriptContext::NormalMethodCall(FXJSE_HOBJECT hThis,
CFX_WideString wsFunName = CFX_WideString::FromUTF8(
(const FX_CHAR*)szFuncName.raw_str(), szFuncName.GetLength());
const XFA_METHODINFO* lpMethodInfo =
- XFA_GetMethodByName(pObject->GetClassID(), wsFunName);
+ XFA_GetMethodByName(pObject->GetClassID(), wsFunName.AsWideStringC());
if (NULL == lpMethodInfo) {
return;
}
« no previous file with comments | « xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp ('k') | xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698