diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-05 12:02:57 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-05 17:20:28 +0000 |
commit | e7767a0c98548395c95b9f88fc30cf7b318f1939 (patch) | |
tree | 952e86c32748c234963aff6ecea2c004d6679fe5 | |
parent | 1ad67cfe58963c29762dc28676bdca2afba803a4 (diff) | |
download | pdfium-e7767a0c98548395c95b9f88fc30cf7b318f1939.tar.xz |
Cleanup CFX_WordBreak
Remove unused GetWord, make methods only used in the class private.
Change-Id: Ia5b63da7f9dc3a918380742213d98f9d1b3651a3
Reviewed-on: https://pdfium-review.googlesource.com/13092
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | core/fxcrt/cfx_wordbreak.cpp | 16 | ||||
-rw-r--r-- | core/fxcrt/cfx_wordbreak.h | 13 |
2 files changed, 4 insertions, 25 deletions
diff --git a/core/fxcrt/cfx_wordbreak.cpp b/core/fxcrt/cfx_wordbreak.cpp index 975dd113c1..1ce85fc0da 100644 --- a/core/fxcrt/cfx_wordbreak.cpp +++ b/core/fxcrt/cfx_wordbreak.cpp @@ -2827,22 +2827,6 @@ int32_t CFX_WordBreak::GetWordLength() const { return m_pCurIter->GetAt() - m_pPreIter->GetAt() + 1; } -void CFX_WordBreak::GetWord(CFX_WideString& wsWord) const { - int32_t nWordLength = GetWordLength(); - if (nWordLength <= 0) { - return; - } - wchar_t* lpBuf = wsWord.GetBuffer(nWordLength); - std::unique_ptr<IFX_CharIter> pTempIter = m_pPreIter->Clone(); - int32_t i = 0; - while (pTempIter->GetAt() <= m_pCurIter->GetAt()) { - lpBuf[i++] = pTempIter->GetChar(); - if (!pTempIter->Next()) - break; - } - wsWord.ReleaseBuffer(nWordLength); -} - bool CFX_WordBreak::IsEOF(bool bTail) const { return m_pCurIter->IsEOF(bTail); } diff --git a/core/fxcrt/cfx_wordbreak.h b/core/fxcrt/cfx_wordbreak.h index 4550fcac7c..4580c0ce8d 100644 --- a/core/fxcrt/cfx_wordbreak.h +++ b/core/fxcrt/cfx_wordbreak.h @@ -9,9 +9,6 @@ #include <memory> -#include "core/fxcrt/fx_string.h" -#include "core/fxcrt/fx_system.h" - class IFX_CharIter; class CFX_WordBreak { @@ -20,17 +17,15 @@ class CFX_WordBreak { ~CFX_WordBreak(); void Attach(IFX_CharIter* pIter); - bool Next(bool bPrev); void SetAt(int32_t nIndex); int32_t GetWordPos() const; int32_t GetWordLength() const; - void GetWord(CFX_WideString& wsWord) const; - bool IsEOF(bool bTail) const; - - protected: - bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev, bool bFromNext = true); private: + bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev, bool bFromNext); + bool IsEOF(bool bTail) const; + bool Next(bool bPrev); + std::unique_ptr<IFX_CharIter> m_pPreIter; std::unique_ptr<IFX_CharIter> m_pCurIter; }; |