blob: 088535cdb79d0cab8ea3f9b6da97286674dacd4e [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2017 The PDFium Authors
Dan Sinclairf4736722017-11-27 18:10:47 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fxfa/parser/cxfa_alwaysembed.h"
8
Tom Sepez148c1442019-01-25 18:56:26 +00009#include "fxjs/xfa/cjx_node.h"
Tom Sepez757a6bf2020-09-17 17:22:38 +000010#include "xfa/fxfa/parser/cxfa_document.h"
Tom Sepez148c1442019-01-25 18:56:26 +000011
Dan Sinclairf4736722017-11-27 18:10:47 +000012namespace {
13
Lei Zhangec7d8e22018-02-07 19:57:25 +000014const CXFA_Node::AttributeData kAlwaysEmbedAttributeData[] = {
Dan Sinclair21b08272017-11-30 20:22:20 +000015 {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr},
16 {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0},
Tom Sepeza8c86c22019-01-25 22:06:03 +000017};
Dan Sinclairf4736722017-11-27 18:10:47 +000018
Dan Sinclairf4736722017-11-27 18:10:47 +000019} // namespace
20
Dan Sinclairc40c5aa2017-11-30 21:29:11 +000021CXFA_AlwaysEmbed::CXFA_AlwaysEmbed(CXFA_Document* doc, XFA_PacketType packet)
Dan Sinclairf4736722017-11-27 18:10:47 +000022 : CXFA_Node(doc,
23 packet,
Tom Sepez0c057582021-08-17 17:37:23 +000024 XFA_XDPPACKET::kConfig,
Dan Sinclairf4736722017-11-27 18:10:47 +000025 XFA_ObjectType::NodeV,
26 XFA_Element::AlwaysEmbed,
Tom Sepezc0fa5f62019-01-25 20:07:27 +000027 {},
Tom Sepez148c1442019-01-25 18:56:26 +000028 kAlwaysEmbedAttributeData,
Tom Sepez757a6bf2020-09-17 17:22:38 +000029 cppgc::MakeGarbageCollected<CJX_Node>(
30 doc->GetHeap()->GetAllocationHandle(),
31 this)) {}
Dan Sinclairf4736722017-11-27 18:10:47 +000032
Tom Sepez7fc43dd2018-12-13 17:54:26 +000033CXFA_AlwaysEmbed::~CXFA_AlwaysEmbed() = default;