1 // Copyright 2017 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/fgas/layout/cfgas_breakline.h" 8 9 #include "core/fxcrt/stl_util.h" 10 #include "third_party/base/check.h" 11 12 CFGAS_BreakLine::CFGAS_BreakLine() = default; 13 14 CFGAS_BreakLine::~CFGAS_BreakLine() = default; 15 LastChar()16CFGAS_Char* CFGAS_BreakLine::LastChar() { 17 if (m_LineChars.empty()) 18 return nullptr; 19 20 return &m_LineChars.back(); 21 } 22 GetLineEnd() const23int32_t CFGAS_BreakLine::GetLineEnd() const { 24 return m_iStart + m_iWidth; 25 } 26 Clear()27void CFGAS_BreakLine::Clear() { 28 m_LineChars.clear(); 29 m_LinePieces.clear(); 30 m_iWidth = 0; 31 m_iArabicChars = 0; 32 } 33 IncrementArabicCharCount()34void CFGAS_BreakLine::IncrementArabicCharCount() { 35 ++m_iArabicChars; 36 } 37 DecrementArabicCharCount()38void CFGAS_BreakLine::DecrementArabicCharCount() { 39 DCHECK(m_iArabicChars > 0); 40 --m_iArabicChars; 41 } 42