Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
26 #include "xfa/src/fxbarcode/oned/BC_OneDimReader.h" 26 #include "xfa/src/fxbarcode/oned/BC_OneDimReader.h"
27 #include "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h" 27 #include "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h"
28 #include "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h" 28 #include "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h"
29 CBC_OnedUPCAReader::CBC_OnedUPCAReader() { 29 CBC_OnedUPCAReader::CBC_OnedUPCAReader() {
30 m_ean13Reader = NULL; 30 m_ean13Reader = NULL;
31 } 31 }
32 void CBC_OnedUPCAReader::Init() { 32 void CBC_OnedUPCAReader::Init() {
33 m_ean13Reader = new CBC_OnedEAN13Reader; 33 m_ean13Reader = new CBC_OnedEAN13Reader;
34 } 34 }
35 CBC_OnedUPCAReader::~CBC_OnedUPCAReader() { 35 CBC_OnedUPCAReader::~CBC_OnedUPCAReader() {
36 if (m_ean13Reader != NULL) { 36 delete m_ean13Reader;
37 delete m_ean13Reader;
38 }
39 m_ean13Reader = NULL;
40 } 37 }
41 CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, 38 CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber,
42 CBC_CommonBitArray* row, 39 CBC_CommonBitArray* row,
43 int32_t hints, 40 int32_t hints,
44 int32_t& e) { 41 int32_t& e) {
45 CFX_ByteString bytestring = 42 CFX_ByteString bytestring =
46 m_ean13Reader->DecodeRow(rowNumber, row, hints, e); 43 m_ean13Reader->DecodeRow(rowNumber, row, hints, e);
47 BC_EXCEPTION_CHECK_ReturnValue(e, ""); 44 BC_EXCEPTION_CHECK_ReturnValue(e, "");
48 CFX_ByteString temp = MaybeReturnResult(bytestring, e); 45 CFX_ByteString temp = MaybeReturnResult(bytestring, e);
49 BC_EXCEPTION_CHECK_ReturnValue(e, ""); 46 BC_EXCEPTION_CHECK_ReturnValue(e, "");
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int32_t& e) { 86 int32_t& e) {
90 if (result[0] == '0') { 87 if (result[0] == '0') {
91 result.Delete(0); 88 result.Delete(0);
92 return result; 89 return result;
93 } else { 90 } else {
94 e = BCExceptionFormatException; 91 e = BCExceptionFormatException;
95 return ""; 92 return "";
96 } 93 }
97 return ""; 94 return "";
98 } 95 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698