Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cxfa_attachnodelist.cpp
Go to the documentation of this file.
1
// Copyright 2016 The PDFium Authors
2
// 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_attachnodelist.h"
8
9
#
include
"xfa/fxfa/parser/cxfa_node.h"
10
11
CXFA_AttachNodeList::CXFA_AttachNodeList(CXFA_Document* pDocument,
12
CXFA_Node
* pAttachNode)
13
:
CXFA_TreeList
(
pDocument
)
, m_pAttachNode(pAttachNode) {}
14
15
CXFA_AttachNodeList::~
CXFA_AttachNodeList
() =
default
;
16
17
void
CXFA_AttachNodeList::
Trace
(
cppgc
::Visitor* visitor)
const
{
18
CXFA_TreeList
::
Trace
(visitor);
19
visitor->Trace(m_pAttachNode);
20
}
21
22
size_t
CXFA_AttachNodeList::
GetLength
() {
23
return
m_pAttachNode->CountChildren(
24
XFA_Element::Unknown,
25
m_pAttachNode->GetElementType() == XFA_Element::Subform);
26
}
27
28
bool
CXFA_AttachNodeList::
Append
(
CXFA_Node
* pNode) {
29
if
(pNode
->
IsAncestorOf
(m_pAttachNode))
30
return
false
;
31
32
CXFA_Node
* pParent = pNode->GetParent();
33
if
(pParent)
34
pParent
->
RemoveChildAndNotify
(
pNode
,
true
)
;
35
36
m_pAttachNode->InsertChildAndNotify(pNode,
nullptr
);
37
return
true
;
38
}
39
40
bool
CXFA_AttachNodeList::
Insert
(
CXFA_Node
* pNewNode,
CXFA_Node
* pBeforeNode) {
41
if
(pNewNode
->
IsAncestorOf
(m_pAttachNode))
42
return
false
;
43
44
if
(pBeforeNode && pBeforeNode->GetParent() != m_pAttachNode)
45
return
false
;
46
47
CXFA_Node
* pParent = pNewNode->GetParent();
48
if
(pParent)
49
pParent
->
RemoveChildAndNotify
(
pNewNode
,
true
)
;
50
51
m_pAttachNode->InsertChildAndNotify(pNewNode, pBeforeNode);
52
return
true
;
53
}
54
55
void
CXFA_AttachNodeList::
Remove
(
CXFA_Node
* pNode) {
56
m_pAttachNode->RemoveChildAndNotify(pNode,
true
);
57
}
58
59
CXFA_Node
* CXFA_AttachNodeList::
Item
(size_t index) {
60
return
m_pAttachNode->GetChild<CXFA_Node>(
61
index, XFA_Element::Unknown,
62
m_pAttachNode->GetElementType() == XFA_Element::Subform);
63
}
CXFA_AttachNodeList::~CXFA_AttachNodeList
~CXFA_AttachNodeList() override
CXFA_AttachNodeList::Insert
bool Insert(CXFA_Node *pNewNode, CXFA_Node *pBeforeNode) override
Definition
cxfa_attachnodelist.cpp:40
CXFA_AttachNodeList::Remove
void Remove(CXFA_Node *pNode) override
Definition
cxfa_attachnodelist.cpp:55
CXFA_AttachNodeList::Item
CXFA_Node * Item(size_t iIndex) override
Definition
cxfa_attachnodelist.cpp:59
CXFA_AttachNodeList::Append
bool Append(CXFA_Node *pNode) override
Definition
cxfa_attachnodelist.cpp:28
CXFA_AttachNodeList::GetLength
size_t GetLength() override
Definition
cxfa_attachnodelist.cpp:22
CXFA_AttachNodeList::Trace
void Trace(cppgc::Visitor *visitor) const override
Definition
cxfa_attachnodelist.cpp:17
CXFA_Node
Definition
cxfa_node.h:94
CXFA_Node::RemoveChildAndNotify
void RemoveChildAndNotify(CXFA_Node *pNode, bool bNotify)
Definition
cxfa_node.cpp:1630
CXFA_Node::IsAncestorOf
bool IsAncestorOf(const CXFA_Node *that) const
Definition
cxfa_node.cpp:1599
CXFA_Object::Trace
virtual void Trace(cppgc::Visitor *visitor) const
Definition
cxfa_object.cpp:33
CXFA_TreeList
Definition
cxfa_treelist.h:15
CXFA_TreeList::CXFA_TreeList
CXFA_TreeList(CXFA_Document *pDocument)
Definition
cxfa_treelist.cpp:14
cppgc
Definition
heap.h:12
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fxfa
parser
cxfa_attachnodelist.cpp
Generated on
for Qt by
1.18.0