summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-21 21:57:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 21:57:35 +0000
commitb06d3f8d7658eeab6624f66aef690a7f4b44936e (patch)
tree7780958ea43c869938dfd538ecb3e53ffbf2c723 /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
parent36261b631e1847bcfdda6d381ae414c954d73e88 (diff)
downloadpdfium-b06d3f8d7658eeab6624f66aef690a7f4b44936e.tar.xz
Cleanup CXFA_OccurData
Make methods const, use return instead of out params. Change-Id: Idfdae8df5cd74ba0bce08c05a6fc34b168d25f79 Reviewed-on: https://pdfium-review.googlesource.com/19050 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index b7b3c0c12e..381e176927 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -46,14 +46,6 @@ struct RecurseRecord {
CXFA_Node* pDataChild;
};
-bool GetOccurInfo(CXFA_Node* pOccurNode,
- int32_t& iMin,
- int32_t& iMax,
- int32_t& iInit) {
- return pOccurNode ? CXFA_OccurData(pOccurNode).GetOccurInfo(iMin, iMax, iInit)
- : false;
-}
-
CXFA_Node* FormValueNode_CreateChild(CXFA_Node* pValueNode, XFA_Element iType) {
CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!pChildNode) {
@@ -597,13 +589,19 @@ CXFA_Node* FindMatchingDataNode(
pCurTemplateNode = pIterator->MoveToNext();
continue;
}
+
CXFA_Node* pTemplateNodeOccur =
pCurTemplateNode->GetFirstChildByClass(XFA_Element::Occur);
- int32_t iMin, iMax, iInit;
- if (pTemplateNodeOccur &&
- GetOccurInfo(pTemplateNodeOccur, iMin, iMax, iInit) && iMax == 0) {
- pCurTemplateNode = pIterator->MoveToNext();
- continue;
+ if (pTemplateNodeOccur) {
+ int32_t iMin;
+ int32_t iMax;
+ int32_t iInit;
+ std::tie(iMin, iMax, iInit) =
+ CXFA_OccurData(pTemplateNodeOccur).GetOccurInfo();
+ if (iMax == 0) {
+ pCurTemplateNode = pIterator->MoveToNext();
+ continue;
+ }
}
CXFA_Node* pTemplateNodeBind =
@@ -750,8 +748,8 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
int32_t iMax = 1;
int32_t iInit = 1;
int32_t iMin = 1;
- if (!bOneInstance)
- GetOccurInfo(pOccurNode, iMin, iMax, iInit);
+ if (!bOneInstance && pOccurNode)
+ std::tie(iMin, iMax, iInit) = CXFA_OccurData(pOccurNode).GetOccurInfo();
XFA_ATTRIBUTEENUM eRelation =
eType == XFA_Element::SubformSet