Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: xfa/fxfa/parser/cxfa_attachnodelist.cpp

Issue 2159973003: Split xfa_object_imp into individual class files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_arraynodelist.cpp ('k') | xfa/fxfa/parser/cxfa_node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
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/xfa_object.h"
8
9 CXFA_AttachNodeList::CXFA_AttachNodeList(CXFA_Document* pDocument,
10 CXFA_Node* pAttachNode)
11 : CXFA_NodeList(pDocument) {
12 m_pAttachNode = pAttachNode;
13 }
14
15 int32_t CXFA_AttachNodeList::GetLength() {
16 return m_pAttachNode->CountChildren(
17 XFA_Element::Unknown,
18 m_pAttachNode->GetElementType() == XFA_Element::Subform);
19 }
20
21 FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
22 CXFA_Node* pParent = pNode->GetNodeItem(XFA_NODEITEM_Parent);
23 if (pParent) {
24 pParent->RemoveChild(pNode);
25 }
26 return m_pAttachNode->InsertChild(pNode);
27 }
28
29 FX_BOOL CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode,
30 CXFA_Node* pBeforeNode) {
31 CXFA_Node* pParent = pNewNode->GetNodeItem(XFA_NODEITEM_Parent);
32 if (pParent) {
33 pParent->RemoveChild(pNewNode);
34 }
35 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode);
36 }
37
38 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
39 return m_pAttachNode->RemoveChild(pNode);
40 }
41
42 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) {
43 return m_pAttachNode->GetChild(
44 iIndex, XFA_Element::Unknown,
45 m_pAttachNode->GetElementType() == XFA_Element::Subform);
46 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/cxfa_arraynodelist.cpp ('k') | xfa/fxfa/parser/cxfa_node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698