summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_engine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-04 19:12:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-04 19:12:16 +0000
commit33beb4e4d34547a4de43f4dee4b2b0483c526b5e (patch)
tree725d0e866857680a0a391ead73bf3e5c88132773 /fxjs/cfxjse_engine.cpp
parent47a90adb7da175cfefe99a3dc40f88521d99b879 (diff)
downloadpdfium-33beb4e4d34547a4de43f4dee4b2b0483c526b5e.tar.xz
Remove SetResultCreateNode
This CL removes the SetResultCreateNode method and inlines into the one caller. The XFA_RESOLVENODE_RSTYPE enum is also renamed XFA_ResolveNode_RSType to make it easier to find XFA_RESOLVENODE_RS objects. Change-Id: I937b612be062c5b7b05fd8d2822cd12cb882ba06 Reviewed-on: https://pdfium-review.googlesource.com/20370 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_engine.cpp')
-rw-r--r--fxjs/cfxjse_engine.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index a2bebdb7f9..821b8da70f 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -175,11 +175,11 @@ bool CFXJSE_Engine::QueryNodeByFlag(CXFA_Node* refNode,
XFA_RESOLVENODE_RS resolveRs;
if (!ResolveObjects(refNode, propname, &resolveRs, dwFlag, nullptr))
return false;
- if (resolveRs.dwFlags == XFA_RESOLVENODE_RSTYPE_Nodes) {
+ if (resolveRs.dwFlags == XFA_ResolveNode_RSType_Nodes) {
pValue->Assign(GetJSValueFromMap(resolveRs.objects.front()));
return true;
}
- if (resolveRs.dwFlags == XFA_RESOLVENODE_RSTYPE_Attribute) {
+ if (resolveRs.dwFlags == XFA_ResolveNode_RSType_Attribute) {
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = resolveRs.pScriptAttribute;
if (lpAttributeInfo) {
CJX_Object* jsObject = resolveRs.objects.front()->JSObject();
@@ -641,11 +641,11 @@ bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
}
rndFind.m_CurObject = findObjects[i++];
rndFind.m_nLevel = nLevel;
- rndFind.m_dwFlag = XFA_RESOLVENODE_RSTYPE_Nodes;
+ rndFind.m_dwFlag = XFA_ResolveNode_RSType_Nodes;
if (!m_ResolveProcessor->Resolve(rndFind))
continue;
- if (rndFind.m_dwFlag == XFA_RESOLVENODE_RSTYPE_Attribute &&
+ if (rndFind.m_dwFlag == XFA_ResolveNode_RSType_Attribute &&
rndFind.m_pScriptAttribute &&
nStart <
pdfium::base::checked_cast<int32_t>(wsExpression.GetLength())) {
@@ -701,17 +701,27 @@ bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
resolveNodeRS->objects.insert(resolveNodeRS->objects.end(),
findObjects.begin(), findObjects.end());
}
- if (rndFind.m_dwFlag == XFA_RESOLVENODE_RSTYPE_Attribute) {
+ if (rndFind.m_dwFlag == XFA_ResolveNode_RSType_Attribute) {
resolveNodeRS->pScriptAttribute = rndFind.m_pScriptAttribute;
return 1;
}
}
if (dwStyles & (XFA_RESOLVENODE_CreateNode | XFA_RESOLVENODE_Bind |
XFA_RESOLVENODE_BindNew)) {
- m_ResolveProcessor->SetResultCreateNode(resolveNodeRS,
- rndFind.m_wsCondition);
+ CXFA_NodeHelper* helper = m_ResolveProcessor->GetNodeHelper();
+ if (helper->m_pCreateParent)
+ resolveNodeRS->objects.push_back(helper->m_pCreateParent);
+ else
+ helper->CreateNode_ForCondition(rndFind.m_wsCondition);
+
+ resolveNodeRS->dwFlags = helper->m_iCreateFlag;
+ if (resolveNodeRS->dwFlags == XFA_ResolveNode_RSType_CreateNodeOne) {
+ if (helper->m_iCurAllStart != -1)
+ resolveNodeRS->dwFlags = XFA_ResolveNode_RSType_CreateNodeMidAll;
+ }
+
if (!bNextCreate && (dwStyles & XFA_RESOLVENODE_CreateNode))
- resolveNodeRS->dwFlags = XFA_RESOLVENODE_RSTYPE_ExistNodes;
+ resolveNodeRS->dwFlags = XFA_ResolveNode_RSType_ExistNodes;
return !resolveNodeRS->objects.empty();
}