OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FPDFDOC_CPVT_WORDRANGE_H_ | 7 #ifndef CORE_FPDFDOC_CPVT_WORDRANGE_H_ |
8 #define CORE_FPDFDOC_CPVT_WORDRANGE_H_ | 8 #define CORE_FPDFDOC_CPVT_WORDRANGE_H_ |
9 | 9 |
10 #include "core/fpdfdoc/cpvt_wordplace.h" | 10 #include "core/fpdfdoc/cpvt_wordplace.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 void SetBeginPos(const CPVT_WordPlace& begin) { | 31 void SetBeginPos(const CPVT_WordPlace& begin) { |
32 BeginPos = begin; | 32 BeginPos = begin; |
33 SwapWordPlace(); | 33 SwapWordPlace(); |
34 } | 34 } |
35 | 35 |
36 void SetEndPos(const CPVT_WordPlace& end) { | 36 void SetEndPos(const CPVT_WordPlace& end) { |
37 EndPos = end; | 37 EndPos = end; |
38 SwapWordPlace(); | 38 SwapWordPlace(); |
39 } | 39 } |
40 | 40 |
41 FX_BOOL IsExist() const { return BeginPos != EndPos; } | 41 bool IsExist() const { return BeginPos != EndPos; } |
42 | 42 |
43 FX_BOOL operator!=(const CPVT_WordRange& wr) const { | 43 bool operator!=(const CPVT_WordRange& wr) const { |
44 return wr.BeginPos != BeginPos || wr.EndPos != EndPos; | 44 return wr.BeginPos != BeginPos || wr.EndPos != EndPos; |
45 } | 45 } |
46 | 46 |
47 void SwapWordPlace() { | 47 void SwapWordPlace() { |
48 if (BeginPos.WordCmp(EndPos) > 0) { | 48 if (BeginPos.WordCmp(EndPos) > 0) { |
49 CPVT_WordPlace place = EndPos; | 49 CPVT_WordPlace place = EndPos; |
50 EndPos = BeginPos; | 50 EndPos = BeginPos; |
51 BeginPos = place; | 51 BeginPos = place; |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 CPVT_WordPlace BeginPos; | 55 CPVT_WordPlace BeginPos; |
56 CPVT_WordPlace EndPos; | 56 CPVT_WordPlace EndPos; |
57 }; | 57 }; |
58 | 58 |
59 #endif // CORE_FPDFDOC_CPVT_WORDRANGE_H_ | 59 #endif // CORE_FPDFDOC_CPVT_WORDRANGE_H_ |
OLD | NEW |