1 // Copyright 2017 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/fgas/layout/cfx_breakline.h"
8 
9 #include "third_party/base/stl_util.h"
10 
11 CFX_BreakLine::CFX_BreakLine() = default;
12 
13 CFX_BreakLine::~CFX_BreakLine() = default;
14 
GetChar(int32_t index)15 CFX_Char* CFX_BreakLine::GetChar(int32_t index) {
16   ASSERT(pdfium::IndexInBounds(m_LineChars, index));
17   return &m_LineChars[index];
18 }
19 
GetLineEnd() const20 int32_t CFX_BreakLine::GetLineEnd() const {
21   return m_iStart + m_iWidth;
22 }
23 
Clear()24 void CFX_BreakLine::Clear() {
25   m_LineChars.clear();
26   m_LinePieces.clear();
27   m_iWidth = 0;
28   m_iArabicChars = 0;
29 }
30 
IncrementArabicCharCount()31 void CFX_BreakLine::IncrementArabicCharCount() {
32   ++m_iArabicChars;
33 }
34 
DecrementArabicCharCount()35 void CFX_BreakLine::DecrementArabicCharCount() {
36   ASSERT(m_iArabicChars > 0);
37   --m_iArabicChars;
38 }
39