summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script_imp.cpp
diff options
context:
space:
mode:
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 =