From e3409535a6ecad8006d872df680ae7eda8120c1c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 28 Feb 2017 14:51:28 -0500 Subject: Remove always true method params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleanup a couple methods in RTFBreak and TextBreak which always recieve true as their parameter. Change-Id: I4704cdb6200b85e0a1a2990d16158ea58699a110 Reviewed-on: https://pdfium-review.googlesource.com/2879 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- xfa/fgas/layout/fgas_textbreak.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'xfa/fgas/layout/fgas_textbreak.cpp') diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index fa38897eca..1ab90b23d3 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -271,9 +271,7 @@ CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, bool bOmitChar) const { return nullptr; } -CFX_TxtLine* CFX_TxtBreak::GetTxtLine(bool bReady) const { - if (!bReady) - return m_pCurLine; +CFX_TxtLine* CFX_TxtBreak::GetTxtLine() const { if (m_iReady == 1) return m_pTxtLine1.get(); if (m_iReady == 2) @@ -281,8 +279,8 @@ CFX_TxtLine* CFX_TxtBreak::GetTxtLine(bool bReady) const { return nullptr; } -CFX_TxtPieceArray* CFX_TxtBreak::GetTxtPieces(bool bReady) const { - CFX_TxtLine* pTxtLine = GetTxtLine(bReady); +CFX_TxtPieceArray* CFX_TxtBreak::GetTxtPieces() const { + CFX_TxtLine* pTxtLine = GetTxtLine(); if (!pTxtLine) { return nullptr; } @@ -927,7 +925,7 @@ uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) { } return dwStatus; } else { - CFX_TxtLine* pLastLine = GetTxtLine(true); + CFX_TxtLine* pLastLine = GetTxtLine(); if (pLastLine) { pCurPieces = pLastLine->m_pLinePieces.get(); iCount = pCurPieces->GetSize(); @@ -1125,12 +1123,12 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine* pCurLine, } int32_t CFX_TxtBreak::CountBreakPieces() const { - CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(true); + CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(); return pTxtPieces ? pTxtPieces->GetSize() : 0; } const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const { - CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(true); + CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(); if (!pTxtPieces) { return nullptr; } @@ -1141,7 +1139,7 @@ const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const { } void CFX_TxtBreak::ClearBreakPieces() { - CFX_TxtLine* pTxtLine = GetTxtLine(true); + CFX_TxtLine* pTxtLine = GetTxtLine(); if (pTxtLine) { pTxtLine->RemoveAll(true); } -- cgit v1.2.3