From 893822aa5b6254591f8e80fbffcbb4fa6ad849aa Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 13 Mar 2017 15:32:07 -0400 Subject: Merge text breaking helper classes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl merges the CFX_TxtPiece and CFX_RTFPiece classes into CFX_BreakPiece. CFX_TxtLine and CFX_RTFLine into CFX_BreakLine and CFX_TxtChar and CFX_RTFChar into CFX_Char. Change-Id: I95421bdf4cafd5e394db9238dea3603ccb8349c3 Reviewed-on: https://pdfium-review.googlesource.com/2966 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fgas/layout/cfx_breakline.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 xfa/fgas/layout/cfx_breakline.h (limited to 'xfa/fgas/layout/cfx_breakline.h') diff --git a/xfa/fgas/layout/cfx_breakline.h b/xfa/fgas/layout/cfx_breakline.h new file mode 100644 index 0000000000..138ee3104e --- /dev/null +++ b/xfa/fgas/layout/cfx_breakline.h @@ -0,0 +1,39 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FGAS_LAYOUT_CFX_BREAKLINE_H_ +#define XFA_FGAS_LAYOUT_CFX_BREAKLINE_H_ + +#include + +#include "core/fxcrt/cfx_char.h" +#include "xfa/fgas/layout/cfx_breakpiece.h" + +class CFX_BreakLine { + public: + CFX_BreakLine(); + ~CFX_BreakLine(); + + int32_t CountChars() const; + CFX_Char* GetChar(int32_t index); + const CFX_Char* GetChar(int32_t index) const; + + int32_t CountPieces() const; + const CFX_BreakPiece* GetPiece(int32_t index) const; + + void GetString(CFX_WideString& wsStr) const; + int32_t GetLineEnd() const; + + void Clear(); + + std::vector m_LineChars; + std::vector m_LinePieces; + int32_t m_iStart; + int32_t m_iWidth; + int32_t m_iArabicChars; +}; + +#endif // XFA_FGAS_LAYOUT_CFX_BREAKLINE_H_ -- cgit v1.2.3