| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 case 103: | 183 case 103: |
| 184 codeSet = CODE_CODE_A; | 184 codeSet = CODE_CODE_A; |
| 185 break; | 185 break; |
| 186 case 104: | 186 case 104: |
| 187 codeSet = CODE_CODE_B; | 187 codeSet = CODE_CODE_B; |
| 188 break; | 188 break; |
| 189 case 105: | 189 case 105: |
| 190 codeSet = CODE_CODE_C; | 190 codeSet = CODE_CODE_C; |
| 191 break; | 191 break; |
| 192 default: | 192 default: |
| 193 if (startPatternInfo != NULL) { | 193 if (startPatternInfo) { |
| 194 startPatternInfo->RemoveAll(); | 194 startPatternInfo->RemoveAll(); |
| 195 delete startPatternInfo; | 195 delete startPatternInfo; |
| 196 startPatternInfo = NULL; | 196 startPatternInfo = NULL; |
| 197 } | 197 } |
| 198 e = BCExceptionFormatException; | 198 e = BCExceptionFormatException; |
| 199 return ""; | 199 return ""; |
| 200 } | 200 } |
| 201 FX_BOOL done = FALSE; | 201 FX_BOOL done = FALSE; |
| 202 FX_BOOL isNextShifted = FALSE; | 202 FX_BOOL isNextShifted = FALSE; |
| 203 CFX_ByteString result; | 203 CFX_ByteString result; |
| 204 int32_t lastStart = (*startPatternInfo)[0]; | 204 int32_t lastStart = (*startPatternInfo)[0]; |
| 205 int32_t nextStart = (*startPatternInfo)[1]; | 205 int32_t nextStart = (*startPatternInfo)[1]; |
| 206 if (startPatternInfo != NULL) { | 206 if (startPatternInfo) { |
| 207 startPatternInfo->RemoveAll(); | 207 startPatternInfo->RemoveAll(); |
| 208 delete startPatternInfo; | 208 delete startPatternInfo; |
| 209 startPatternInfo = NULL; | 209 startPatternInfo = NULL; |
| 210 } | 210 } |
| 211 CFX_Int32Array counters; | 211 CFX_Int32Array counters; |
| 212 counters.SetSize(6); | 212 counters.SetSize(6); |
| 213 int32_t lastCode = 0; | 213 int32_t lastCode = 0; |
| 214 int32_t code = 0; | 214 int32_t code = 0; |
| 215 int32_t checksumTotal = startCode; | 215 int32_t checksumTotal = startCode; |
| 216 int32_t multiplier = 0; | 216 int32_t multiplier = 0; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } else { | 360 } else { |
| 361 result = result.Mid(0, result.GetLength() - 1); | 361 result = result.Mid(0, result.GetLength() - 1); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 if (result.GetLength() == 0) { | 364 if (result.GetLength() == 0) { |
| 365 e = BCExceptionFormatException; | 365 e = BCExceptionFormatException; |
| 366 return ""; | 366 return ""; |
| 367 } | 367 } |
| 368 return result; | 368 return result; |
| 369 } | 369 } |
| OLD | NEW |