diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-14 16:20:01 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-14 16:20:01 +0000 |
commit | 2fa6441d686e1205eb25ed2cbfc4cf47d96efec6 (patch) | |
tree | ad5ebfd6bb73d0db5c5b81b61597c7b0f18f9a0f /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | |
parent | d8d6f55140bd4f0a67de833346113cfa6e03c4bd (diff) | |
download | pdfium-2fa6441d686e1205eb25ed2cbfc4cf47d96efec6.tar.xz |
Cleanup CXFA_Node::SetFlag
The SetFlag method has a signature of (flag, bool) which, looking at the
callsites makes you think it will set the flag to the boolean. This
isn't what happens, the flag is always set to true and the boolean
decides if we execute some notification code.
This CL splits SetFlag into SetFlag(flag) and SetFlagAndNotify(flag) to
make it a lot clearer what is happening.
Change-Id: I3e067c87532cce10b94bda10cc88feb62b948eb0
Reviewed-on: https://pdfium-review.googlesource.com/26750
Reviewed-by: Ryan Harrison <rharrison@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.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index b06c9ce549..8ad38afe2d 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -729,7 +729,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument, pOccurNode->ClearFlag(XFA_NodeFlag_UnusedNode); } if (pInstMgrNode) { - pInstMgrNode->SetFlag(XFA_NodeFlag_Initialized, true); + pInstMgrNode->SetFlagAndNotify(XFA_NodeFlag_Initialized); pSearchArray = &subformArray; if (pFormParentNode->GetElementType() == XFA_Element::PageArea) { bOneInstance = true; @@ -1029,7 +1029,7 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument, pDataNode->JSObject()->SetCData(XFA_Attribute::Name, wsName, false, false); pDataNode->CreateXMLMappingNode(); pDataParent->InsertChild(pDataNode, nullptr); - pDataNode->SetFlag(XFA_NodeFlag_Initialized, false); + pDataNode->SetFlag(XFA_NodeFlag_Initialized); return pDataNode; } @@ -1065,7 +1065,7 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument, } pDataParent->InsertChild(pDataNode, nullptr); pDataNode->SetDataDescriptionNode(pDDNode); - pDataNode->SetFlag(XFA_NodeFlag_Initialized, false); + pDataNode->SetFlag(XFA_NodeFlag_Initialized); return pDataNode; } return nullptr; @@ -1285,7 +1285,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer( } } } - pExistingNode->SetFlag(XFA_NodeFlag_Initialized, true); + pExistingNode->SetFlagAndNotify(XFA_NodeFlag_Initialized); return pExistingNode; } @@ -1448,7 +1448,7 @@ void CXFA_Document::DoDataMerge() { sIterator(pFormRoot); for (CXFA_Node* pNode = sIterator.MoveToNext(); pNode; pNode = sIterator.MoveToNext()) { - pNode->SetFlag(XFA_NodeFlag_UnusedNode, true); + pNode->SetFlag(XFA_NodeFlag_UnusedNode); } } @@ -1513,11 +1513,11 @@ void CXFA_Document::DoDataMerge() { pNode = pNext; } else { pNode->ClearFlag(XFA_NodeFlag_UnusedNode); - pNode->SetFlag(XFA_NodeFlag_Initialized, true); + pNode->SetFlagAndNotify(XFA_NodeFlag_Initialized); pNode = sIterator.MoveToNext(); } } else { - pNode->SetFlag(XFA_NodeFlag_Initialized, true); + pNode->SetFlagAndNotify(XFA_NodeFlag_Initialized); pNode = sIterator.MoveToNext(); } } |