summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 18:32:08 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 18:32:08 +0000
commita95fd60b7902b9f893d05189aa6c877eb2e73e90 (patch)
tree59c7e977600be1fe1f40a792fbe369708d7797b8 /fxjs/cjx_node.cpp
parent92492c1455e59c18f274c1f2b3ecfe9d042509fa (diff)
downloadpdfium-a95fd60b7902b9f893d05189aa6c877eb2e73e90.tar.xz
Remove default value from CJX_Node::GetProperty
This CL removes the GetProperty default value and inlines into the callers. Change-Id: I0e18f27b51046fdf37ddc57f34a31154729c8db0 Reviewed-on: https://pdfium-review.googlesource.com/17510 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjx_node.cpp')
-rw-r--r--fxjs/cjx_node.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index 59ddab5db0..0c78f99551 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -684,7 +684,7 @@ void CJX_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) {
if (iLength >= 2)
iValue = pArguments->GetInt32(1);
CXFA_Node* pNode = GetProperty(
- iValue, XFA_GetElementTypeForName(wsExpression.AsStringView()));
+ iValue, XFA_GetElementTypeForName(wsExpression.AsStringView()), true);
pArguments->GetReturnValue()->Assign(
GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode));
}
@@ -710,14 +710,12 @@ void CJX_Node::Script_NodeClass_IsPropertySpecified(
bool bParent = iLength < 2 || pArguments->GetInt32(1);
int32_t iIndex = iLength == 3 ? pArguments->GetInt32(2) : 0;
XFA_Element eType = XFA_GetElementTypeForName(wsExpression.AsStringView());
- bHas = !!GetProperty(iIndex, eType);
+ bHas = !!GetProperty(iIndex, eType, true);
if (!bHas && bParent && GetXFANode()->GetParent()) {
// Also check on the parent.
- bHas = GetXFANode()->GetParent()->JSNode()->HasAttribute(
- pAttributeInfo->eName);
- if (!bHas)
- bHas =
- !!GetXFANode()->GetParent()->JSNode()->GetProperty(iIndex, eType);
+ auto* jsnode = GetXFANode()->GetParent()->JSNode();
+ bHas = jsnode->HasAttribute(pAttributeInfo->eName) ||
+ !!jsnode->GetProperty(iIndex, eType, true);
}
}
pValue->SetBoolean(bHas);
@@ -3331,7 +3329,7 @@ bool CJX_Node::SetScriptContent(const WideString& wsContent,
switch (GetXFANode()->GetObjectType()) {
case XFA_ObjectType::ContainerNode: {
if (XFA_FieldIsMultiListBox(GetXFANode())) {
- CXFA_Node* pValue = GetProperty(0, XFA_Element::Value);
+ CXFA_Node* pValue = GetProperty(0, XFA_Element::Value, true);
if (!pValue)
break;
@@ -3412,7 +3410,7 @@ bool CJX_Node::SetScriptContent(const WideString& wsContent,
if (GetXFANode()->GetElementType() == XFA_Element::ExclGroup) {
pNode = GetXFANode();
} else {
- CXFA_Node* pValue = GetProperty(0, XFA_Element::Value);
+ CXFA_Node* pValue = GetProperty(0, XFA_Element::Value, true);
if (!pValue)
break;