| 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 17 matching lines...) Expand all Loading... |
| 28 #include "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h" | 28 #include "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h" |
| 29 #include "xfa/src/fxbarcode/utils.h" | 29 #include "xfa/src/fxbarcode/utils.h" |
| 30 | 30 |
| 31 CBC_OnedUPCAReader::CBC_OnedUPCAReader() { | 31 CBC_OnedUPCAReader::CBC_OnedUPCAReader() { |
| 32 m_ean13Reader = NULL; | 32 m_ean13Reader = NULL; |
| 33 } | 33 } |
| 34 void CBC_OnedUPCAReader::Init() { | 34 void CBC_OnedUPCAReader::Init() { |
| 35 m_ean13Reader = new CBC_OnedEAN13Reader; | 35 m_ean13Reader = new CBC_OnedEAN13Reader; |
| 36 } | 36 } |
| 37 CBC_OnedUPCAReader::~CBC_OnedUPCAReader() { | 37 CBC_OnedUPCAReader::~CBC_OnedUPCAReader() { |
| 38 if (m_ean13Reader != NULL) { | 38 delete m_ean13Reader; |
| 39 delete m_ean13Reader; | |
| 40 } | |
| 41 m_ean13Reader = NULL; | |
| 42 } | 39 } |
| 43 CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, | 40 CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, |
| 44 CBC_CommonBitArray* row, | 41 CBC_CommonBitArray* row, |
| 45 int32_t hints, | 42 int32_t hints, |
| 46 int32_t& e) { | 43 int32_t& e) { |
| 47 CFX_ByteString bytestring = | 44 CFX_ByteString bytestring = |
| 48 m_ean13Reader->DecodeRow(rowNumber, row, hints, e); | 45 m_ean13Reader->DecodeRow(rowNumber, row, hints, e); |
| 49 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 46 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
| 50 CFX_ByteString temp = MaybeReturnResult(bytestring, e); | 47 CFX_ByteString temp = MaybeReturnResult(bytestring, e); |
| 51 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 48 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 int32_t& e) { | 88 int32_t& e) { |
| 92 if (result[0] == '0') { | 89 if (result[0] == '0') { |
| 93 result.Delete(0); | 90 result.Delete(0); |
| 94 return result; | 91 return result; |
| 95 } else { | 92 } else { |
| 96 e = BCExceptionFormatException; | 93 e = BCExceptionFormatException; |
| 97 return ""; | 94 return ""; |
| 98 } | 95 } |
| 99 return ""; | 96 return ""; |
| 100 } | 97 } |
| OLD | NEW |