summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_resolveprocessor.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-10 16:28:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-10 16:28:57 +0000
commit640d8ffad8536c789103892c7a4e69e5d30172c8 (patch)
treeebd3f4013383a2319c95d29a10097f4bdb28ea30 /fxjs/cfxjse_resolveprocessor.cpp
parent594b3eeeaa61a2c0a6d84df3e17ea587f3b15c23 (diff)
downloadpdfium-640d8ffad8536c789103892c7a4e69e5d30172c8.tar.xz
Make methods which create nodes more obvious
This CL converts the various methods Get methods which take a boolean value to explicit Get* and GetOrCreate* methods to make the usage clearer. Change-Id: I2af68448b1b69b95713e739bf7fe14a4336d2b65 Reviewed-on: https://pdfium-review.googlesource.com/22590 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_resolveprocessor.cpp')
-rw-r--r--fxjs/cfxjse_resolveprocessor.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/fxjs/cfxjse_resolveprocessor.cpp b/fxjs/cfxjse_resolveprocessor.cpp
index beb0541a49..b602db24ec 100644
--- a/fxjs/cfxjse_resolveprocessor.cpp
+++ b/fxjs/cfxjse_resolveprocessor.cpp
@@ -346,14 +346,16 @@ bool CFXJSE_ResolveProcessor::ResolveNormal(CFXJSE_ResolveNodeData& rnd) {
CXFA_Node* pInstanceManager =
curNode->AsNode()->GetInstanceMgrOfSubform();
if (pInstanceManager) {
- pProp = pInstanceManager->JSObject()->GetProperty<CXFA_Occur>(
- 0, XFA_Element::Occur, true);
+ pProp = pInstanceManager->JSObject()->GetOrCreateProperty<CXFA_Occur>(
+ 0, XFA_Element::Occur);
}
} else {
XFA_Element eType = CXFA_Node::NameToElement(wsName);
- if (eType != XFA_Element::Unknown) {
- pProp = curNode->AsNode()->JSObject()->GetProperty<CXFA_Node>(
- 0, eType, eType != XFA_Element::PageSet);
+ if (eType == XFA_Element::PageSet) {
+ pProp = curNode->AsNode()->JSObject()->GetProperty<CXFA_Node>(0, eType);
+ } else if (eType != XFA_Element::Unknown) {
+ pProp = curNode->AsNode()->JSObject()->GetOrCreateProperty<CXFA_Node>(
+ 0, eType);
}
}
if (pProp) {