OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2008 ZXing authors | 8 * Copyright 2008 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 int32_t& e) { | 45 int32_t& e) { |
46 FX_BOOL foundStart = FALSE; | 46 FX_BOOL foundStart = FALSE; |
47 CFX_Int32Array* startRange = NULL; | 47 CFX_Int32Array* startRange = NULL; |
48 CFX_Int32Array startEndPattern; | 48 CFX_Int32Array startEndPattern; |
49 startEndPattern.SetSize(3); | 49 startEndPattern.SetSize(3); |
50 startEndPattern[0] = START_END_PATTERN[0]; | 50 startEndPattern[0] = START_END_PATTERN[0]; |
51 startEndPattern[1] = START_END_PATTERN[1]; | 51 startEndPattern[1] = START_END_PATTERN[1]; |
52 startEndPattern[2] = START_END_PATTERN[2]; | 52 startEndPattern[2] = START_END_PATTERN[2]; |
53 int32_t nextStart = 0; | 53 int32_t nextStart = 0; |
54 while (!foundStart) { | 54 while (!foundStart) { |
55 if (startRange != NULL) { | 55 delete startRange; |
56 delete startRange; | |
57 startRange = NULL; | |
58 } | |
59 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e); | 56 startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e); |
60 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 57 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
61 int32_t start = (*startRange)[0]; | 58 int32_t start = (*startRange)[0]; |
62 nextStart = (*startRange)[1]; | 59 nextStart = (*startRange)[1]; |
63 if (start <= 1) { | 60 if (start <= 1) { |
64 break; | 61 break; |
65 } | 62 } |
66 int32_t quietStart = start - (nextStart - start); | 63 int32_t quietStart = start - (nextStart - start); |
67 if (quietStart >= 0) { | 64 if (quietStart >= 0) { |
68 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e); | 65 FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 210 } |
214 } | 211 } |
215 if (bestMatch >= 0) { | 212 if (bestMatch >= 0) { |
216 return bestMatch; | 213 return bestMatch; |
217 } else { | 214 } else { |
218 e = BCExceptionNotFound; | 215 e = BCExceptionNotFound; |
219 return 0; | 216 return 0; |
220 } | 217 } |
221 return 0; | 218 return 0; |
222 } | 219 } |
OLD | NEW |