From e80576173df7488964e588f5ac52f9af4b046021 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 16 Jan 2018 21:32:26 +0000 Subject: Clean up xfa/fde/cfde_textout.h. - Move enums/structs other than CFDE_TextOut to a separate header. - Move CFDE_TTOLine into CFDE_TextOut. Change-Id: I63196ebe6c02bc88d1c20ecb625505013edbfa26 Reviewed-on: https://pdfium-review.googlesource.com/22930 Reviewed-by: Ryan Harrison Commit-Queue: Lei Zhang --- xfa/fde/cfde_textout.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'xfa/fde/cfde_textout.cpp') diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp index 2f41525c00..19e7ae6934 100644 --- a/xfa/fde/cfde_textout.cpp +++ b/xfa/fde/cfde_textout.cpp @@ -15,6 +15,7 @@ #include "core/fxge/cfx_pathdata.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" +#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fgas/layout/cfx_txtbreak.h" namespace { @@ -530,16 +531,18 @@ int32_t CFDE_TextOut::GetDisplayPos(FDE_TTOPIECE* pPiece) { return m_pTxtBreak->GetDisplayPos(&tr, m_CharPos.data()); } -CFDE_TTOLine::CFDE_TTOLine() : m_bNewReload(false) {} +CFDE_TextOut::CFDE_TTOLine::CFDE_TTOLine() : m_bNewReload(false) {} -CFDE_TTOLine::CFDE_TTOLine(const CFDE_TTOLine& ttoLine) : m_pieces(5) { +CFDE_TextOut::CFDE_TTOLine::CFDE_TTOLine(const CFDE_TTOLine& ttoLine) + : m_pieces(5) { m_bNewReload = ttoLine.m_bNewReload; m_pieces = ttoLine.m_pieces; } -CFDE_TTOLine::~CFDE_TTOLine() {} +CFDE_TextOut::CFDE_TTOLine::~CFDE_TTOLine() {} -int32_t CFDE_TTOLine::AddPiece(int32_t index, const FDE_TTOPIECE& ttoPiece) { +int32_t CFDE_TextOut::CFDE_TTOLine::AddPiece(int32_t index, + const FDE_TTOPIECE& ttoPiece) { if (index >= pdfium::CollectionSize(m_pieces)) { m_pieces.push_back(ttoPiece); return pdfium::CollectionSize(m_pieces); @@ -548,15 +551,15 @@ int32_t CFDE_TTOLine::AddPiece(int32_t index, const FDE_TTOPIECE& ttoPiece) { return index; } -int32_t CFDE_TTOLine::GetSize() const { +int32_t CFDE_TextOut::CFDE_TTOLine::GetSize() const { return pdfium::CollectionSize(m_pieces); } -FDE_TTOPIECE* CFDE_TTOLine::GetPtrAt(int32_t index) { +FDE_TTOPIECE* CFDE_TextOut::CFDE_TTOLine::GetPtrAt(int32_t index) { return pdfium::IndexInBounds(m_pieces, index) ? &m_pieces[index] : nullptr; } -void CFDE_TTOLine::RemoveLast(int32_t icount) { +void CFDE_TextOut::CFDE_TTOLine::RemoveLast(int32_t icount) { if (icount < 0) return; m_pieces.erase( -- cgit v1.2.3