From 1c97fd137e03a22c69be6d0162197e2add6b81e0 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 9 Mar 2017 16:58:55 -0500 Subject: Remove unused TextBreak methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl removes some CFX_TxtBreak methods which aren't called. Change-Id: Ic66a89fa9c99aefb78d8314e1a3ebee089ef83cf Reviewed-on: https://pdfium-review.googlesource.com/2940 Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fgas/layout/fgas_textbreak.cpp | 24 ++---------------------- xfa/fgas/layout/fgas_textbreak.h | 4 ---- 2 files changed, 2 insertions(+), 26 deletions(-) (limited to 'xfa') diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 832521dbee..4989a26e23 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -63,7 +63,6 @@ CFX_TxtBreak::CFX_TxtBreak() m_iAlignment(FX_TXTLINEALIGNMENT_Left), m_dwContextCharStyles(0), m_iCombWidth(360000), - m_pUserData(nullptr), m_eCharType(FX_CHARTYPE_Unknown), m_bArabicNumber(false), m_bArabicComma(false), @@ -85,13 +84,6 @@ void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) { ASSERT(m_iLineWidth >= 20000); } -void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos) { - int32_t iLinePos = - std::min(std::max(FXSYS_round(fLinePos * 20000.0f), 0), m_iLineWidth); - m_pCurLine->m_iStart = iLinePos; - m_pCurLine->m_iWidth += iLinePos; -} - void CFX_TxtBreak::SetLayoutStyles(uint32_t dwLayoutStyles) { m_dwLayoutStyles = dwLayoutStyles; m_bVertical = (m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0; @@ -199,14 +191,6 @@ void CFX_TxtBreak::SetCombWidth(FX_FLOAT fCombWidth) { m_iCombWidth = FXSYS_round(fCombWidth * 20000.0f); } -void CFX_TxtBreak::SetUserData(void* pUserData) { - if (m_pUserData == pUserData) - return; - - SetBreakStatus(); - m_pUserData = pUserData; -} - void CFX_TxtBreak::SetBreakStatus() { int32_t iCount = m_pCurLine->CountChars(); if (iCount < 1) @@ -295,7 +279,6 @@ void CFX_TxtBreak::ResetArabicContext() { void CFX_TxtBreak::AppendChar_PageLoad(CFX_TxtChar* pCurChar, uint32_t dwProps) { pCurChar->m_dwStatus = CFX_BreakType::None; - pCurChar->m_pUserData = m_pUserData; if (m_bArabicContext || m_bArabicShapes) { int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; @@ -547,7 +530,7 @@ CFX_BreakType CFX_TxtBreak::AppendChar(FX_WCHAR wch) { pCurChar->m_iBidiLevel = 0; pCurChar->m_iBidiPos = 0; pCurChar->m_iBidiOrder = 0; - pCurChar->m_pUserData = nullptr; + AppendChar_PageLoad(pCurChar, dwProps); CFX_BreakType dwRet1 = CFX_BreakType::None; if (chartype != FX_CHARTYPE_Combination && @@ -693,7 +676,6 @@ void CFX_TxtBreak::EndBreak_BidiLine(std::deque* tpos, tp.m_iBidiLevel = iBidiLevel; tp.m_iBidiPos = pTC->m_iBidiOrder; tp.m_dwCharStyles = pTC->m_dwCharStyles; - tp.m_pUserData = pTC->m_pUserData; tp.m_iHorizontalScale = pTC->m_iHorizontalScale; tp.m_iVerticalScale = pTC->m_iVerticalScale; tp.m_dwStatus = CFX_BreakType::Piece; @@ -753,7 +735,6 @@ void CFX_TxtBreak::EndBreak_BidiLine(std::deque* tpos, tp.m_iStartChar = 0; tp.m_iChars = iCount; tp.m_pChars = &m_pCurLine->m_LineChars; - tp.m_pUserData = m_pUserData; pTC = &chars[0]; tp.m_dwCharStyles = pTC->m_dwCharStyles; tp.m_iHorizontalScale = pTC->m_iHorizontalScale; @@ -1597,8 +1578,7 @@ CFX_TxtPiece::CFX_TxtPiece() m_iHorizontalScale(100), m_iVerticalScale(100), m_dwCharStyles(0), - m_pChars(nullptr), - m_pUserData(nullptr) {} + m_pChars(nullptr) {} CFX_TxtLine::CFX_TxtLine() : m_LinePieces(16), m_iStart(0), m_iWidth(0), m_iArabicChars(0) {} diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index 75be69b520..e9c37ee5d9 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -145,7 +145,6 @@ class CFX_TxtPiece { int32_t m_iVerticalScale; uint32_t m_dwCharStyles; std::vector* m_pChars; - void* m_pUserData; }; typedef CFX_BaseArrayTemplate CFX_TxtPieceArray; @@ -203,7 +202,6 @@ class CFX_TxtBreak { ~CFX_TxtBreak(); void SetLineWidth(FX_FLOAT fLineWidth); - void SetLinePos(FX_FLOAT fLinePos); uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; } void SetLayoutStyles(uint32_t dwLayoutStyles); void SetFont(const CFX_RetainPtr& pFont); @@ -217,7 +215,6 @@ class CFX_TxtBreak { void SetCharSpace(FX_FLOAT fCharSpace); void SetAlignment(int32_t iAlignment); void SetCombWidth(FX_FLOAT fCombWidth); - void SetUserData(void* pUserData); CFX_BreakType EndBreak(CFX_BreakType dwStatus); int32_t CountBreakPieces() const; const CFX_TxtPiece* GetBreakPiece(int32_t index) const; @@ -285,7 +282,6 @@ class CFX_TxtBreak { int32_t m_iAlignment; uint32_t m_dwContextCharStyles; int32_t m_iCombWidth; - void* m_pUserData; FX_CHARTYPE m_eCharType; bool m_bCurRTL; int32_t m_iCurAlignment; -- cgit v1.2.3