From 555b31faa192c7a85c84979bea28d4914e93c784 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 5 Sep 2017 16:46:33 -0400 Subject: Remove unused CFX_WordBreak::Next method CFX_WordBreak::Next is never called, removed. This was the only method to pass a different value for the bFromNext param for FindNextBreakPos() so that param was also removed. Change-Id: I14ca0dc65490ec64209ba0b872794f75b3e3104f Reviewed-on: https://pdfium-review.googlesource.com/13210 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- core/fxcrt/cfx_wordbreak.cpp | 37 +++++++------------------------------ core/fxcrt/cfx_wordbreak.h | 3 +-- 2 files changed, 8 insertions(+), 32 deletions(-) (limited to 'core/fxcrt') diff --git a/core/fxcrt/cfx_wordbreak.cpp b/core/fxcrt/cfx_wordbreak.cpp index 1ce85fc0da..7a5d8f7dcd 100644 --- a/core/fxcrt/cfx_wordbreak.cpp +++ b/core/fxcrt/cfx_wordbreak.cpp @@ -2788,35 +2788,14 @@ void CFX_WordBreak::Attach(IFX_CharIter* pIter) { m_pCurIter.reset(pIter); } -bool CFX_WordBreak::Next(bool bPrev) { - std::unique_ptr pIter = - (bPrev ? m_pPreIter : m_pCurIter)->Clone(); - if (pIter->IsEOF(!bPrev)) - return false; - - pIter->Next(bPrev); - if (!FindNextBreakPos(pIter.get(), bPrev, true)) - return false; - - if (bPrev) { - m_pCurIter = std::move(m_pPreIter); - m_pCurIter->Next(true); - m_pPreIter = std::move(pIter); - } else { - m_pPreIter = std::move(m_pCurIter); - m_pPreIter->Next(); - m_pCurIter = std::move(pIter); - } - return true; -} - void CFX_WordBreak::SetAt(int32_t nIndex) { m_pPreIter.reset(); m_pCurIter->SetAt(nIndex); - FindNextBreakPos(m_pCurIter.get(), true, false); + FindNextBreakPos(m_pCurIter.get(), true); + m_pPreIter = std::move(m_pCurIter); m_pCurIter = m_pPreIter->Clone(); - FindNextBreakPos(m_pCurIter.get(), false, false); + FindNextBreakPos(m_pCurIter.get(), false); } int32_t CFX_WordBreak::GetWordPos() const { @@ -2831,16 +2810,14 @@ bool CFX_WordBreak::IsEOF(bool bTail) const { return m_pCurIter->IsEOF(bTail); } -bool CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter, - bool bPrev, - bool bFromNext) { +bool CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter, bool bPrev) { FX_WordBreakProp ePreType = FX_WordBreakProp_None; FX_WordBreakProp eCurType = FX_WordBreakProp_None; FX_WordBreakProp eNextType = FX_WordBreakProp_None; - if (pIter->IsEOF(!bPrev)) { + if (pIter->IsEOF(!bPrev)) return true; - } - if (!(bFromNext || pIter->IsEOF(bPrev))) { + + if (!pIter->IsEOF(bPrev)) { pIter->Next(!bPrev); ePreType = GetWordBreakProperty(pIter->GetChar()); pIter->Next(bPrev); diff --git a/core/fxcrt/cfx_wordbreak.h b/core/fxcrt/cfx_wordbreak.h index 4580c0ce8d..59c071be03 100644 --- a/core/fxcrt/cfx_wordbreak.h +++ b/core/fxcrt/cfx_wordbreak.h @@ -22,9 +22,8 @@ class CFX_WordBreak { int32_t GetWordLength() const; private: - bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev, bool bFromNext); + bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev); bool IsEOF(bool bTail) const; - bool Next(bool bPrev); std::unique_ptr m_pPreIter; std::unique_ptr m_pCurIter; -- cgit v1.2.3