Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: core/fpdfdoc/include/cpvt_wordrange.h

Issue 2374383003: Move core/fpdfdoc/include to core/fpdfdoc (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/include/cpvt_wordprops.h ('k') | core/fpdfdoc/include/fpdf_tagged.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef CORE_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_
8 #define CORE_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_
9
10 #include "core/fpdfdoc/include/cpvt_wordplace.h"
11 #include "core/fxcrt/include/fx_system.h"
12
13 struct CPVT_WordRange {
14 CPVT_WordRange() {}
15
16 CPVT_WordRange(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) {
17 Set(begin, end);
18 }
19
20 void Default() {
21 BeginPos.Default();
22 EndPos.Default();
23 }
24
25 void Set(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) {
26 BeginPos = begin;
27 EndPos = end;
28 SwapWordPlace();
29 }
30
31 void SetBeginPos(const CPVT_WordPlace& begin) {
32 BeginPos = begin;
33 SwapWordPlace();
34 }
35
36 void SetEndPos(const CPVT_WordPlace& end) {
37 EndPos = end;
38 SwapWordPlace();
39 }
40
41 FX_BOOL IsExist() const { return BeginPos != EndPos; }
42
43 FX_BOOL operator!=(const CPVT_WordRange& wr) const {
44 return wr.BeginPos != BeginPos || wr.EndPos != EndPos;
45 }
46
47 void SwapWordPlace() {
48 if (BeginPos.WordCmp(EndPos) > 0) {
49 CPVT_WordPlace place = EndPos;
50 EndPos = BeginPos;
51 BeginPos = place;
52 }
53 }
54
55 CPVT_WordPlace BeginPos;
56 CPVT_WordPlace EndPos;
57 };
58
59 #endif // CORE_FPDFDOC_INCLUDE_CPVT_WORDRANGE_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/include/cpvt_wordprops.h ('k') | core/fpdfdoc/include/fpdf_tagged.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698