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/fxfa/cxfa_texttabstopscontext.h" 8 9 #include <algorithm> 10 11 CXFA_TextTabstopsContext::CXFA_TextTabstopsContext() = default; 12 13 CXFA_TextTabstopsContext::~CXFA_TextTabstopsContext() = default; 14 Append(uint32_t dwAlign,float fTabstops)15void CXFA_TextTabstopsContext::Append(uint32_t dwAlign, float fTabstops) { 16 XFA_TABSTOPS tabstop; 17 tabstop.dwAlign = dwAlign; 18 tabstop.fTabstops = fTabstops; 19 20 auto it = std::lower_bound(m_tabstops.begin(), m_tabstops.end(), tabstop); 21 m_tabstops.insert(it, tabstop); 22 } 23 RemoveAll()24void CXFA_TextTabstopsContext::RemoveAll() { 25 m_tabstops.clear(); 26 } 27 Reset()28void CXFA_TextTabstopsContext::Reset() { 29 m_iTabIndex = -1; 30 m_bHasTabstops = false; 31 m_fTabWidth = 0; 32 m_fLeft = 0; 33 } 34