summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script_imp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-23 12:14:55 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-23 12:14:55 -0700
commit6e12478cb298c3a8277493ee79ae0b73d6df8554 (patch)
tree46e28dbab97bbe41cca67ace9a3a05429c9cd519 /xfa/fxfa/parser/xfa_script_imp.cpp
parentf7f659c2c98a4d02e3695266d33f449b7be01af9 (diff)
downloadpdfium-6e12478cb298c3a8277493ee79ae0b73d6df8554.tar.xz
Change XFA_GetElementByName to XFA_GetElementTypeForName
This method was only ever used to get the XFA_Element type for the given element name. Changed to make the signature match the usage. Review-Url: https://codereview.chromium.org/2095733002
Diffstat (limited to 'xfa/fxfa/parser/xfa_script_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_script_imp.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index ee7576ebf1..2afa5fcdec 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -319,13 +319,12 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
}
CXFA_Node* pNode = ToNode(pObject);
CXFA_Node* pPropOrChild = nullptr;
- const XFA_ELEMENTINFO* lpElementInfo =
- XFA_GetElementByName(wsPropName.AsStringC());
- if (lpElementInfo) {
- pPropOrChild = pNode->GetProperty(0, lpElementInfo->eName);
- } else {
+ XFA_Element eType = XFA_GetElementTypeForName(wsPropName.AsStringC());
+ if (eType != XFA_Element::Unknown)
+ pPropOrChild = pNode->GetProperty(0, eType);
+ else
pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsStringC());
- }
+
if (pPropOrChild) {
CFX_WideString wsDefaultName(L"{default}");
const XFA_SCRIPTATTRIBUTEINFO* lpAttrInfo =