summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-06 14:41:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-06 14:41:50 +0000
commite7ccf36f0498b69850a1ab7774b981e63cc8009d (patch)
tree8814b45260982e36b1ff7a2ee505951387f7fca9
parent4e7a55ebf491df0999b9fb21aeee259495b943eb (diff)
downloadpdfium-e7ccf36f0498b69850a1ab7774b981e63cc8009d.tar.xz
Remove recursive paramter from CJX_Node::MoveBufferMapData
The recursive paramter is always true, so remove it and fixup code as needed. Change-Id: I18395c1bca415d8a5d85c1eee6a32870c5d7f7e3 Reviewed-on: https://pdfium-review.googlesource.com/17591 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--fxjs/cjx_node.cpp20
-rw-r--r--fxjs/cjx_node.h3
2 files changed, 10 insertions, 13 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index f102f3ae10..e653795a4b 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -813,7 +813,7 @@ void CJX_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
else
pFakeXMLRoot = nullptr;
}
- MoveBufferMapData(pFakeRoot, GetXFANode(), XFA_CalcData, true);
+ MoveBufferMapData(pFakeRoot, GetXFANode(), XFA_CalcData);
} else {
CXFA_Node* pChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChild) {
@@ -3894,19 +3894,17 @@ void CJX_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) {
void CJX_Node::MoveBufferMapData(CXFA_Node* pSrcModule,
CXFA_Node* pDstModule,
- void* pKey,
- bool bRecursive) {
+ void* pKey) {
if (!pSrcModule || !pDstModule || !pKey)
return;
- if (bRecursive) {
- CXFA_Node* pSrcChild = pSrcModule->GetNodeItem(XFA_NODEITEM_FirstChild);
- CXFA_Node* pDstChild = pDstModule->GetNodeItem(XFA_NODEITEM_FirstChild);
- for (; pSrcChild && pDstChild;
- pSrcChild = pSrcChild->GetNodeItem(XFA_NODEITEM_NextSibling),
- pDstChild = pDstChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- MoveBufferMapData(pSrcChild, pDstChild, pKey, true);
- }
+ CXFA_Node* pSrcChild = pSrcModule->GetNodeItem(XFA_NODEITEM_FirstChild);
+ CXFA_Node* pDstChild = pDstModule->GetNodeItem(XFA_NODEITEM_FirstChild);
+ while (pSrcChild && pDstChild) {
+ MoveBufferMapData(pSrcChild, pDstChild, pKey);
+
+ pSrcChild = pSrcChild->GetNodeItem(XFA_NODEITEM_NextSibling);
+ pDstChild = pDstChild->GetNodeItem(XFA_NODEITEM_NextSibling);
}
pSrcModule->JSNode()->MoveBufferMapData(pDstModule, pKey);
}
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index 02091b924b..80ee6ae4b2 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -448,8 +448,7 @@ class CJX_Node : public CJX_Object {
void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey);
void MoveBufferMapData(CXFA_Node* pSrcModule,
CXFA_Node* pDstModule,
- void* pKey,
- bool bRecursive);
+ void* pKey);
int32_t execSingleEventByName(const WideStringView& wsEventName,
XFA_Element eType);