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

Side by Side Diff: core/fpdfdoc/clines.cpp

Issue 2060913003: Make code compile with clang_use_chrome_plugin (part II) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 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 | « core/fpdfdoc/clines.h ('k') | core/fpdfdoc/cpdf_variabletext.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 "core/fpdfdoc/clines.h"
8
9 CLines::CLines() : m_nTotal(0) {}
10
11 CLines::~CLines() {
12 RemoveAll();
13 }
14
15 int32_t CLines::GetSize() const {
16 return m_Lines.GetSize();
17 }
18
19 CLine* CLines::GetAt(int32_t nIndex) const {
20 return m_Lines.GetAt(nIndex);
21 }
22
23 void CLines::Empty() {
24 m_nTotal = 0;
25 }
26
27 void CLines::RemoveAll() {
28 for (int32_t i = 0, sz = GetSize(); i < sz; i++)
29 delete GetAt(i);
30 m_Lines.RemoveAll();
31 m_nTotal = 0;
32 }
33
34 int32_t CLines::Add(const CPVT_LineInfo& lineinfo) {
35 if (m_nTotal >= GetSize()) {
36 CLine* pLine = new CLine;
37 pLine->m_LineInfo = lineinfo;
38 m_Lines.Add(pLine);
39 } else if (CLine* pLine = GetAt(m_nTotal)) {
40 pLine->m_LineInfo = lineinfo;
41 }
42 return m_nTotal++;
43 }
44
45 void CLines::Clear() {
46 for (int32_t i = GetSize() - 1; i >= m_nTotal; i--) {
47 delete GetAt(i);
48 m_Lines.RemoveAt(i);
49 }
50 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/clines.h ('k') | core/fpdfdoc/cpdf_variabletext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698