From db0cc520a3ea43e9a81f5e936616e27b0927ef2b Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Mar 2017 11:48:04 -0400 Subject: Simplify TxtBreak AppendChar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the array of AppendChar methods and use a switch instead to clarify the code. Change-Id: I68809caf70919bf6d8dab16bfd3fa2e9ff2b7f90 Reviewed-on: https://pdfium-review.googlesource.com/3062 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- xfa/fgas/layout/fgas_textbreak.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xfa/fgas/layout/fgas_textbreak.h') diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index 054fe39344..0fe4268a0f 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -74,15 +74,16 @@ class CFX_TxtBreak : public CFX_Break { CFX_WideString* pWSForms = nullptr) const; std::vector GetCharRects(const FX_TXTRUN* pTxtRun, bool bCharBBox = false) const; - void AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps); CFX_BreakType AppendChar(wchar_t wch); - CFX_BreakType AppendChar_Combination(CFX_Char* pCurChar); - CFX_BreakType AppendChar_Tab(CFX_Char* pCurChar); + + private: + void AppendChar_Combination(CFX_Char* pCurChar); + void AppendChar_Tab(CFX_Char* pCurChar); + void AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps); CFX_BreakType AppendChar_Control(CFX_Char* pCurChar); CFX_BreakType AppendChar_Arabic(CFX_Char* pCurChar); CFX_BreakType AppendChar_Others(CFX_Char* pCurChar); - private: void SetBreakStatus() override; CFX_Char* GetLastChar(int32_t index, bool bOmitChar = true) const; bool HasTxtLine() const { return m_iReadyLineIndex >= 0; } -- cgit v1.2.3