From 68dde3bce9bb5594b8c1320a0114ebc4be9d3ee7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 14 Feb 2018 16:21:30 +0000 Subject: Cleanup some CXFA_Node flags and methods. This CL removes one unused flag and inlines the check for if the node has an owned XML node. Change-Id: Id750192b37f09901a81e2faaa929a81d2262d4c7 Reviewed-on: https://pdfium-review.googlesource.com/26770 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_node.cpp | 2 +- xfa/fxfa/parser/cxfa_node.h | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 46e601d556..a534d6ee4f 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -537,7 +537,7 @@ CXFA_Node::CXFA_Node(CXFA_Document* pDoc, pdfium::MakeUnique(this)) {} CXFA_Node::~CXFA_Node() { - if (m_pXMLNode && IsOwnedXMLNode()) + if (m_pXMLNode && HasFlag(XFA_NodeFlag_OwnXMLNode)) delete m_pXMLNode; } diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index f34bd9bfba..8193f59e05 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -67,10 +67,9 @@ enum XFA_NodeFlag { XFA_NodeFlag_NeedsInitApp = 1 << 2, XFA_NodeFlag_BindFormItems = 1 << 3, XFA_NodeFlag_UserInteractive = 1 << 4, - XFA_NodeFlag_SkipDataBinding = 1 << 5, - XFA_NodeFlag_OwnXMLNode = 1 << 6, - XFA_NodeFlag_UnusedNode = 1 << 7, - XFA_NodeFlag_LayoutGeneratedNode = 1 << 8 + XFA_NodeFlag_OwnXMLNode = 1 << 5, + XFA_NodeFlag_UnusedNode = 1 << 6, + XFA_NodeFlag_LayoutGeneratedNode = 1 << 7 }; class CXFA_Node : public CXFA_Object { @@ -470,7 +469,6 @@ class CXFA_Node : public CXFA_Object { void SetImageEdit(const WideString& wsContentType, const WideString& wsHref, const WideString& wsData); - bool IsOwnedXMLNode() const { return HasFlag(XFA_NodeFlag_OwnXMLNode); } CXFA_Node* GetBindingNode() const { if (binding_nodes_.empty()) return nullptr; -- cgit v1.2.3