diff options
author | thestig <thestig@chromium.org> | 2016-04-14 18:29:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-14 18:29:56 -0700 |
commit | b1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397 (patch) | |
tree | 4bef693fc2b5722a86d75ee6110da8c9d5530f6d /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | |
parent | b1c80fb8b843a2a345b2cd6005e591dc731355f4 (diff) | |
download | pdfium-b1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397.tar.xz |
Simplify XFA event handling.
- Avoid casting to void*
- Don't bother firing events that no one listens for
Review URL: https://codereview.chromium.org/1890563003
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index f0c2d7645a..6ee4ec8d9a 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -524,7 +524,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, pFormParent->RemoveChild(pExistingNode); pFormParent->InsertChild(pExistingNode); } - pExistingNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE); + pExistingNode->ClearFlag(XFA_NODEFLAG_UnusedNode); pExistingNode->SetTemplateNode(pTemplateNode); if (bRecursive && pExistingNode->GetClassID() != XFA_ELEMENT_Items) { for (CXFA_Node* pTemplateChild = @@ -537,7 +537,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument, } } } - pExistingNode->SetFlag(XFA_NODEFLAG_Initialized); + pExistingNode->SetFlag(XFA_NODEFLAG_Initialized, true); return pExistingNode; } CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(FALSE); @@ -590,7 +590,7 @@ static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager( } pFormParent->RemoveChild(pExistingNode); pFormParent->InsertChild(pExistingNode); - pExistingNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE); + pExistingNode->ClearFlag(XFA_NODEFLAG_UnusedNode); pExistingNode->SetTemplateNode(pTemplateNode); return pExistingNode; } @@ -784,11 +784,11 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( } else if (pInstMgrNode) { pOccurNode = pInstMgrNode->GetFirstChildByClass(XFA_ELEMENT_Occur); if (pOccurNode) { - pOccurNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE); + pOccurNode->ClearFlag(XFA_NODEFLAG_UnusedNode); } } if (pInstMgrNode) { - pInstMgrNode->SetFlag(XFA_NODEFLAG_Initialized); + pInstMgrNode->SetFlag(XFA_NODEFLAG_Initialized, true); pSearchArray = &subformArray; if (pFormParentNode->GetClassID() == XFA_ELEMENT_PageArea) { bOneInstance = TRUE; @@ -1347,7 +1347,7 @@ void CXFA_Document::DoDataMerge() { sIterator(pFormRoot); for (CXFA_Node* pNode = sIterator.MoveToNext(); pNode; pNode = sIterator.MoveToNext()) { - pNode->SetFlag(XFA_NODEFLAG_UnusedNode); + pNode->SetFlag(XFA_NODEFLAG_UnusedNode, true); } } CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( @@ -1405,12 +1405,12 @@ void CXFA_Document::DoDataMerge() { pNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pNode); pNode = pNext; } else { - pNode->SetFlag(XFA_NODEFLAG_UnusedNode, FALSE); - pNode->SetFlag(XFA_NODEFLAG_Initialized); + pNode->ClearFlag(XFA_NODEFLAG_UnusedNode); + pNode->SetFlag(XFA_NODEFLAG_Initialized, true); pNode = sIterator.MoveToNext(); } } else { - pNode->SetFlag(XFA_NODEFLAG_Initialized); + pNode->SetFlag(XFA_NODEFLAG_Initialized, true); pNode = sIterator.MoveToNext(); } } |