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

Side by Side Diff: xfa/fxfa/parser/cxfa_arraynodelist.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.gyp ('k') | xfa/fxfa/parser/cxfa_attachnodelist.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_ArrayNodeList::CXFA_ArrayNodeList(CXFA_Document* pDocument)
10 : CXFA_NodeList(pDocument) {}
11
12 CXFA_ArrayNodeList::~CXFA_ArrayNodeList() {}
13
14 void CXFA_ArrayNodeList::SetArrayNodeList(const CXFA_NodeArray& srcArray) {
15 if (srcArray.GetSize() > 0) {
16 m_array.Copy(srcArray);
17 }
18 }
19
20 int32_t CXFA_ArrayNodeList::GetLength() {
21 return m_array.GetSize();
22 }
23
24 FX_BOOL CXFA_ArrayNodeList::Append(CXFA_Node* pNode) {
25 m_array.Add(pNode);
26 return TRUE;
27 }
28
29 FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode,
30 CXFA_Node* pBeforeNode) {
31 if (!pBeforeNode) {
32 m_array.Add(pNewNode);
33 } else {
34 int32_t iSize = m_array.GetSize();
35 for (int32_t i = 0; i < iSize; ++i) {
36 if (m_array[i] == pBeforeNode) {
37 m_array.InsertAt(i, pNewNode);
38 break;
39 }
40 }
41 }
42 return TRUE;
43 }
44
45 FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) {
46 int32_t iSize = m_array.GetSize();
47 for (int32_t i = 0; i < iSize; ++i) {
48 if (m_array[i] == pNode) {
49 m_array.RemoveAt(i);
50 break;
51 }
52 }
53 return TRUE;
54 }
55
56 CXFA_Node* CXFA_ArrayNodeList::Item(int32_t iIndex) {
57 int32_t iSize = m_array.GetSize();
58 if (iIndex >= 0 && iIndex < iSize) {
59 return m_array[iIndex];
60 }
61 return nullptr;
62 }
OLDNEW
« no previous file with comments | « xfa.gyp ('k') | xfa/fxfa/parser/cxfa_attachnodelist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698