From 52f69b39403b1ac0df0fdf45698e80e60c0f2def Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 21 Mar 2017 13:42:38 -0700 Subject: 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 Reviewed-by: dsinclair --- core/fpdfdoc/csection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc/csection.cpp') 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(); -- cgit v1.2.3