summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_object_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_object_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_object_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 06ffb10a18..47b244fce5 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -881,9 +881,8 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
CFX_WideString::FromUTF8(pArguments->GetUTF8String(0).AsStringC());
if (iLength >= 2)
iValue = pArguments->GetInt32(1);
- const XFA_ELEMENTINFO* pElementInfo =
- XFA_GetElementByName(wsExpression.AsStringC());
- CXFA_Node* pNode = GetProperty(iValue, pElementInfo->eName);
+ CXFA_Node* pNode =
+ GetProperty(iValue, XFA_GetElementTypeForName(wsExpression.AsStringC()));
pArguments->GetReturnValue()->Assign(
m_pDocument->GetScriptContext()->GetJSValueFromMap(pNode));
}
@@ -911,14 +910,13 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(
if (pAttributeInfo)
bHas = HasAttribute(pAttributeInfo->eName);
if (!bHas) {
- const XFA_ELEMENTINFO* pElementInfo =
- XFA_GetElementByName(wsExpression.AsStringC());
- bHas = !!GetProperty(iIndex, pElementInfo->eName);
+ XFA_Element eType = XFA_GetElementTypeForName(wsExpression.AsStringC());
+ bHas = !!GetProperty(iIndex, eType);
if (!bHas && bParent && m_pParent) {
// Also check on the parent.
bHas = m_pParent->HasAttribute(pAttributeInfo->eName);
if (!bHas)
- bHas = !!m_pParent->GetProperty(iIndex, pElementInfo->eName);
+ bHas = !!m_pParent->GetProperty(iIndex, eType);
}
}
CFXJSE_Value* pValue = pArguments->GetReturnValue();
@@ -2628,14 +2626,13 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) {
strNameSpace = CFX_WideString::FromUTF8(bsNameSpace.AsStringC());
}
}
- const XFA_ELEMENTINFO* pElement =
- XFA_GetElementByName(strTagName.AsStringC());
- CXFA_Node* pNewNode = CreateSamePacketNode(pElement->eName);
+ XFA_Element eType = XFA_GetElementTypeForName(strTagName.AsStringC());
+ CXFA_Node* pNewNode = CreateSamePacketNode(eType);
if (!pNewNode) {
pArguments->GetReturnValue()->SetNull();
} else {
if (!strName.IsEmpty()) {
- if (XFA_GetAttributeOfElement(pElement->eName, XFA_ATTRIBUTE_Name,
+ if (XFA_GetAttributeOfElement(eType, XFA_ATTRIBUTE_Name,
XFA_XDPPACKET_UNKNOWN)) {
pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, strName.AsStringC(), true);
if (pNewNode->GetPacketID() == XFA_XDPPACKET_Datasets) {