From 52c73c24ab053e839182d3cdac6cbb758ce3a196 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 9 Mar 2017 13:27:29 -0500 Subject: Remove unused Txt break policies. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are unset in the code, remove support. Change-Id: I76ef73929a1f74f59ccdd7bbd054d04dc9c5c6e7 Reviewed-on: https://pdfium-review.googlesource.com/2938 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fgas/layout/fgas_textbreak.h | 50 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 26 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 69ca835fad..72fab9d6a1 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -23,10 +23,6 @@ class CFX_TxtPiece; class IFX_TxtAccess; struct FDE_TEXTEDITPIECE; -#define FX_TXTBREAKPOLICY_None 0x00 -#define FX_TXTBREAKPOLICY_Pagination 0x01 -#define FX_TXTBREAKPOLICY_SpaceBreak 0x02 -#define FX_TXTBREAKPOLICY_NumberBreak 0x04 #define FX_TXTBREAK_None 0x00 #define FX_TXTBREAK_PieceBreak 0x01 #define FX_TXTBREAK_LineBreak 0x02 @@ -162,42 +158,46 @@ typedef CFX_BaseArrayTemplate CFX_TxtPieceArray; class CFX_TxtLine { public: - explicit CFX_TxtLine(int32_t iBlockSize); + CFX_TxtLine(); ~CFX_TxtLine(); int32_t CountChars() const { - return pdfium::CollectionSize(*m_pLineChars); + return pdfium::CollectionSize(m_LineChars); } - CFX_TxtChar* GetCharPtr(int32_t index) const { - ASSERT(index >= 0 && - index < pdfium::CollectionSize(*m_pLineChars)); - return &(*m_pLineChars)[index]; + CFX_TxtChar* GetCharPtr(int32_t index) { + ASSERT(index >= 0 && index < pdfium::CollectionSize(m_LineChars)); + return &m_LineChars[index]; + } + + const CFX_TxtChar* GetCharPtr(int32_t index) const { + ASSERT(index >= 0 && index < pdfium::CollectionSize(m_LineChars)); + return &m_LineChars[index]; } - int32_t CountPieces() const { return m_pLinePieces->GetSize(); } + int32_t CountPieces() const { return m_LinePieces.GetSize(); } CFX_TxtPiece* GetPiecePtr(int32_t index) const { - ASSERT(index > -1 && index < m_pLinePieces->GetSize()); - return m_pLinePieces->GetPtrAt(index); + ASSERT(index > -1 && index < m_LinePieces.GetSize()); + return m_LinePieces.GetPtrAt(index); } void GetString(CFX_WideString& wsStr) const { - int32_t iCount = pdfium::CollectionSize(*m_pLineChars); + int32_t iCount = pdfium::CollectionSize(m_LineChars); FX_WCHAR* pBuf = wsStr.GetBuffer(iCount); for (int32_t i = 0; i < iCount; i++) - *pBuf++ = static_cast((*m_pLineChars)[i].m_wCharCode); + *pBuf++ = static_cast(m_LineChars[i].m_wCharCode); wsStr.ReleaseBuffer(iCount); } void RemoveAll(bool bLeaveMemory = false) { - m_pLineChars->clear(); - m_pLinePieces->RemoveAll(bLeaveMemory); + m_LineChars.clear(); + m_LinePieces.RemoveAll(bLeaveMemory); m_iWidth = 0; m_iArabicChars = 0; } - std::unique_ptr> m_pLineChars; - std::unique_ptr m_pLinePieces; + std::vector m_LineChars; + CFX_TxtPieceArray m_LinePieces; int32_t m_iStart; int32_t m_iWidth; int32_t m_iArabicChars; @@ -205,7 +205,7 @@ class CFX_TxtLine { class CFX_TxtBreak { public: - explicit CFX_TxtBreak(uint32_t dwPolicies); + CFX_TxtBreak(); ~CFX_TxtBreak(); void SetLineWidth(FX_FLOAT fLineWidth); @@ -248,8 +248,8 @@ class CFX_TxtBreak { void SetBreakStatus(); int32_t GetLineRotation(uint32_t dwStyles) const; CFX_TxtChar* GetLastChar(int32_t index, bool bOmitChar = true) const; - CFX_TxtLine* GetTxtLine() const; - CFX_TxtPieceArray* GetTxtPieces() const; + const CFX_TxtLine* GetTxtLine() const; + const CFX_TxtPieceArray* GetTxtPieces() const; FX_CHARTYPE GetUnifiedCharType(FX_CHARTYPE dwType) const; void ResetArabicContext(); void ResetContextCharStyles(); @@ -269,8 +269,6 @@ class CFX_TxtBreak { CFX_TxtLine* pNextLine, bool bAllChars = false); - uint32_t m_dwPolicies; - bool m_bPagination; int32_t m_iLineWidth; uint32_t m_dwLayoutStyles; bool m_bVertical; @@ -300,8 +298,8 @@ class CFX_TxtBreak { int32_t m_iCurAlignment; bool m_bArabicNumber; bool m_bArabicComma; - std::unique_ptr m_pTxtLine1; - std::unique_ptr m_pTxtLine2; + CFX_TxtLine m_TxtLine1; + CFX_TxtLine m_TxtLine2; CFX_TxtLine* m_pCurLine; int32_t m_iReady; int32_t m_iTolerance; -- cgit v1.2.3