summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_layoutitem.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-29 23:18:09 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-29 23:18:09 +0000
commit09646f2d0497eb4cdcf2f3843585faa9264196f4 (patch)
tree82b6ec32ab2edd616a1ea99b11ef8459bef7efaf /xfa/fxfa/parser/cxfa_layoutitem.h
parent0894dc84013cd6a814136ccd40f585fc2eb895f3 (diff)
downloadpdfium-chromium/3478.tar.xz
Use UnownedPtr<CXFA_Node> or comment raw pointers as tree nodes.chromium/3479chromium/3478
Part 2. Change-Id: I26fe434dac3c3f5186414440acc2a495a5f14091 Reviewed-on: https://pdfium-review.googlesource.com/36670 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_layoutitem.h')
-rw-r--r--xfa/fxfa/parser/cxfa_layoutitem.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_layoutitem.h b/xfa/fxfa/parser/cxfa_layoutitem.h
index e03f455de5..6e51a05e69 100644
--- a/xfa/fxfa/parser/cxfa_layoutitem.h
+++ b/xfa/fxfa/parser/cxfa_layoutitem.h
@@ -7,6 +7,7 @@
#ifndef XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_
#define XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_
+#include "core/fxcrt/unowned_ptr.h"
#include "xfa/fxfa/parser/cxfa_document.h"
class CXFA_ContainerLayoutItem;
@@ -23,9 +24,11 @@ class CXFA_LayoutItem {
CXFA_ContentLayoutItem* AsContentLayoutItem();
CXFA_ContainerLayoutItem* GetPage() const;
- CXFA_Node* GetFormNode() const { return m_pFormNode; }
CFX_RectF GetRect(bool bRelative) const;
+ CXFA_Node* GetFormNode() const { return m_pFormNode.Get(); }
+ void SetFormNode(CXFA_Node* pNode) { m_pFormNode = pNode; }
+
int32_t GetIndex() const;
int32_t GetCount() const;
@@ -40,15 +43,15 @@ class CXFA_LayoutItem {
void RemoveChild(CXFA_LayoutItem* pChildItem);
void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem);
- CXFA_Node* m_pFormNode;
- CXFA_LayoutItem* m_pParent;
- CXFA_LayoutItem* m_pNextSibling;
- CXFA_LayoutItem* m_pFirstChild;
+ CXFA_LayoutItem* m_pParent = nullptr; // Raw, intra-tree pointer.
+ CXFA_LayoutItem* m_pNextSibling = nullptr; // Raw, intra-tree pointer.
+ CXFA_LayoutItem* m_pFirstChild = nullptr; // Raw, intra-tree pointer.
protected:
CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem);
bool m_bIsContentLayoutItem;
+ UnownedPtr<CXFA_Node> m_pFormNode;
};
void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem);