aboutsummaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_line.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_line.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_line.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_line.cpp b/xfa/fxfa/parser/cxfa_line.cpp
index 2ac97b2dd..7ab08c34c 100644
--- a/xfa/fxfa/parser/cxfa_line.cpp
+++ b/xfa/fxfa/parser/cxfa_line.cpp
@@ -1,4 +1,4 @@
-// Copyright 2017 PDFium Authors. All rights reserved.
+// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,14 +7,14 @@
#include "xfa/fxfa/parser/cxfa_line.h"
#include "fxjs/xfa/cjx_node.h"
-#include "third_party/base/ptr_util.h"
+#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_edge.h"
#include "xfa/fxfa/parser/cxfa_node.h"
namespace {
const CXFA_Node::PropertyData kLinePropertyData[] = {
- {XFA_Element::Edge, 1, 0},
+ {XFA_Element::Edge, 1, {}},
};
const CXFA_Node::AttributeData kLineAttributeData[] = {
@@ -29,15 +29,24 @@ const CXFA_Node::AttributeData kLineAttributeData[] = {
} // namespace
+// static
+CXFA_Line* CXFA_Line::FromNode(CXFA_Node* pNode) {
+ return pNode && pNode->GetElementType() == XFA_Element::Line
+ ? static_cast<CXFA_Line*>(pNode)
+ : nullptr;
+}
+
CXFA_Line::CXFA_Line(CXFA_Document* doc, XFA_PacketType packet)
: CXFA_Node(doc,
packet,
- (XFA_XDPPACKET_Template | XFA_XDPPACKET_Form),
+ {XFA_XDPPACKET::kTemplate, XFA_XDPPACKET::kForm},
XFA_ObjectType::Node,
XFA_Element::Line,
kLinePropertyData,
kLineAttributeData,
- pdfium::MakeUnique<CJX_Node>(this)) {}
+ cppgc::MakeGarbageCollected<CJX_Node>(
+ doc->GetHeap()->GetAllocationHandle(),
+ this)) {}
CXFA_Line::~CXFA_Line() = default;