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

Side by Side Diff: core/fpdfdoc/include/cpvt_wordplace.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_word.h ('k') | core/fpdfdoc/include/cpvt_wordprops.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_WORDPLACE_H_
8 #define CORE_FPDFDOC_INCLUDE_CPVT_WORDPLACE_H_
9
10 #include "core/fxcrt/include/fx_system.h"
11
12 struct CPVT_WordPlace {
13 CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1) {}
14
15 CPVT_WordPlace(int32_t other_nSecIndex,
16 int32_t other_nLineIndex,
17 int32_t other_nWordIndex) {
18 nSecIndex = other_nSecIndex;
19 nLineIndex = other_nLineIndex;
20 nWordIndex = other_nWordIndex;
21 }
22
23 void Default() { nSecIndex = nLineIndex = nWordIndex = -1; }
24
25 bool operator==(const CPVT_WordPlace& wp) const {
26 return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex &&
27 wp.nWordIndex == nWordIndex;
28 }
29
30 FX_BOOL operator!=(const CPVT_WordPlace& wp) const { return !(*this == wp); }
31
32 inline int32_t WordCmp(const CPVT_WordPlace& wp) const {
33 if (nSecIndex > wp.nSecIndex)
34 return 1;
35 if (nSecIndex < wp.nSecIndex)
36 return -1;
37 if (nLineIndex > wp.nLineIndex)
38 return 1;
39 if (nLineIndex < wp.nLineIndex)
40 return -1;
41 if (nWordIndex > wp.nWordIndex)
42 return 1;
43 if (nWordIndex < wp.nWordIndex)
44 return -1;
45 return 0;
46 }
47
48 inline int32_t LineCmp(const CPVT_WordPlace& wp) const {
49 if (nSecIndex > wp.nSecIndex)
50 return 1;
51 if (nSecIndex < wp.nSecIndex)
52 return -1;
53 if (nLineIndex > wp.nLineIndex)
54 return 1;
55 if (nLineIndex < wp.nLineIndex)
56 return -1;
57 return 0;
58 }
59
60 inline int32_t SecCmp(const CPVT_WordPlace& wp) const {
61 if (nSecIndex > wp.nSecIndex)
62 return 1;
63 if (nSecIndex < wp.nSecIndex)
64 return -1;
65 return 0;
66 }
67
68 int32_t nSecIndex;
69 int32_t nLineIndex;
70 int32_t nWordIndex;
71 };
72
73 #endif // CORE_FPDFDOC_INCLUDE_CPVT_WORDPLACE_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/include/cpvt_word.h ('k') | core/fpdfdoc/include/cpvt_wordprops.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698