diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-05 16:46:33 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-06 13:08:01 +0000 |
commit | 555b31faa192c7a85c84979bea28d4914e93c784 (patch) | |
tree | ad5c7240b1b130cafe740d6c69b89c82afbd7d96 /core/fxcrt | |
parent | a1e87070ac95bb9dba76d7e31ec9ddeb9bc75cd3 (diff) | |
download | pdfium-555b31faa192c7a85c84979bea28d4914e93c784.tar.xz |
Remove unused CFX_WordBreak::Next methodchromium/3208
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 <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/cfx_wordbreak.cpp | 37 | ||||
-rw-r--r-- | core/fxcrt/cfx_wordbreak.h | 3 |
2 files changed, 8 insertions, 32 deletions
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<IFX_CharIter> 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<IFX_CharIter> m_pPreIter; std::unique_ptr<IFX_CharIter> m_pCurIter; |