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