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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 : m_usingCheckDigit(usingCheckDigit), m_extendedMode(extendedMode) { | 49 : m_usingCheckDigit(usingCheckDigit), m_extendedMode(extendedMode) { |
50 } | 50 } |
51 CBC_OnedCode39Reader::~CBC_OnedCode39Reader() {} | 51 CBC_OnedCode39Reader::~CBC_OnedCode39Reader() {} |
52 CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber, | 52 CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber, |
53 CBC_CommonBitArray* row, | 53 CBC_CommonBitArray* row, |
54 int32_t hints, | 54 int32_t hints, |
55 int32_t& e) { | 55 int32_t& e) { |
56 CFX_Int32Array* start = FindAsteriskPattern(row, e); | 56 CFX_Int32Array* start = FindAsteriskPattern(row, e); |
57 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 57 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
58 int32_t nextStart = (*start)[1]; | 58 int32_t nextStart = (*start)[1]; |
59 if (start != NULL) { | 59 delete start; |
60 delete start; | |
61 start = NULL; | |
62 } | |
63 int32_t end = row->GetSize(); | 60 int32_t end = row->GetSize(); |
64 while (nextStart < end && !row->Get(nextStart)) { | 61 while (nextStart < end && !row->Get(nextStart)) { |
65 nextStart++; | 62 nextStart++; |
66 } | 63 } |
67 CFX_ByteString result; | 64 CFX_ByteString result; |
68 CFX_Int32Array counters; | 65 CFX_Int32Array counters; |
69 counters.SetSize(9); | 66 counters.SetSize(9); |
70 FX_CHAR decodedChar; | 67 FX_CHAR decodedChar; |
71 int32_t lastStart; | 68 int32_t lastStart; |
72 do { | 69 do { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 break; | 281 break; |
285 } | 282 } |
286 decoded += decodedChar; | 283 decoded += decodedChar; |
287 i++; | 284 i++; |
288 } else { | 285 } else { |
289 decoded += c; | 286 decoded += c; |
290 } | 287 } |
291 } | 288 } |
292 return decoded; | 289 return decoded; |
293 } | 290 } |
OLD | NEW |