diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-21 13:42:38 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-21 22:34:49 +0000 |
commit | 52f69b39403b1ac0df0fdf45698e80e60c0f2def (patch) | |
tree | 75c62cdb179bc287f283794600f252783603ad9f /core/fpdfdoc/csection.cpp | |
parent | 7dd72a3f39c09a7fdc34558061831620bc149420 (diff) | |
download | pdfium-52f69b39403b1ac0df0fdf45698e80e60c0f2def.tar.xz |
Make CPVT_WordPlace more conformant with the prevailing idioms.
Add relational operators to replace CmpWord().
Leave CmpLine() for the moment as it saves some work.
Remove CmpSec() and just inline comparison of the one member.
Invert IsExist() as IsEmpty(). There is a big philosophical
discussion as to whether things that are empty exist. I say
they do, but they're just empty.
Rename Default() to Reset(). Default sounds like a noun.
Add AdvanceSection() method and call as appropriate.
Change-Id: I01d9479f63a4860e0fd228255540d6d94dc24a9f
Reviewed-on: https://pdfium-review.googlesource.com/3139
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/csection.cpp')
-rw-r--r-- | core/fpdfdoc/csection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfdoc/csection.cpp b/core/fpdfdoc/csection.cpp index 6198d780fd..b6f45a274c 100644 --- a/core/fpdfdoc/csection.cpp +++ b/core/fpdfdoc/csection.cpp @@ -237,14 +237,14 @@ void CSection::ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex) { void CSection::ClearWords(const CPVT_WordRange& PlaceRange) { CPVT_WordPlace SecBeginPos = GetBeginWordPlace(); CPVT_WordPlace SecEndPos = GetEndWordPlace(); - if (PlaceRange.BeginPos.WordCmp(SecBeginPos) >= 0) { - if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) { + if (PlaceRange.BeginPos >= SecBeginPos) { + if (PlaceRange.EndPos <= SecEndPos) { ClearMidWords(PlaceRange.BeginPos.nWordIndex, PlaceRange.EndPos.nWordIndex); } else { ClearRightWords(PlaceRange.BeginPos.nWordIndex); } - } else if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) { + } else if (PlaceRange.EndPos <= SecEndPos) { ClearLeftWords(PlaceRange.EndPos.nWordIndex); } else { m_WordArray.clear(); |