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

Side by Side Diff: xfa/fxbarcode/common/BC_CommonDecoderResult.cpp

Issue 2048983002: Get rid of NULLs in xfa/fxbarcode/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 4 years, 6 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 2007 ZXing authors 8 * Copyright 2007 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 22 matching lines...) Expand all
33 CBC_QRCoderErrorCorrectionLevel* ecLevel, 33 CBC_QRCoderErrorCorrectionLevel* ecLevel,
34 int32_t& e) { 34 int32_t& e) {
35 if (text.IsEmpty()) { 35 if (text.IsEmpty()) {
36 e = BCExceptionIllegalArgument; 36 e = BCExceptionIllegalArgument;
37 return; 37 return;
38 } 38 }
39 m_rawBytes.Copy(rawBytes); 39 m_rawBytes.Copy(rawBytes);
40 m_text = text; 40 m_text = text;
41 m_byteSegments.Copy(byteSegments); 41 m_byteSegments.Copy(byteSegments);
42 m_ecLevel = ecLevel; 42 m_ecLevel = ecLevel;
43 m_other = NULL; 43 m_other = nullptr;
44 } 44 }
45 void CBC_CommonDecoderResult::Init(const CFX_ByteArray& rawBytes, 45 void CBC_CommonDecoderResult::Init(const CFX_ByteArray& rawBytes,
46 const CFX_ByteString& text, 46 const CFX_ByteString& text,
47 const CFX_ByteString& ecLevel, 47 const CFX_ByteString& ecLevel,
48 int32_t& e) { 48 int32_t& e) {
49 if (text.IsEmpty()) { 49 if (text.IsEmpty()) {
50 e = BCExceptionIllegalArgument; 50 e = BCExceptionIllegalArgument;
51 return; 51 return;
52 } 52 }
53 m_rawBytes.Copy(rawBytes); 53 m_rawBytes.Copy(rawBytes);
54 m_text = text; 54 m_text = text;
55 m_pdf417ecLevel = ecLevel; 55 m_pdf417ecLevel = ecLevel;
56 m_other = NULL; 56 m_other = nullptr;
57 } 57 }
58 void CBC_CommonDecoderResult::setOther(CBC_PDF417ResultMetadata* other) { 58 void CBC_CommonDecoderResult::setOther(CBC_PDF417ResultMetadata* other) {
59 m_other = other; 59 m_other = other;
60 } 60 }
61 CBC_CommonDecoderResult::~CBC_CommonDecoderResult() { 61 CBC_CommonDecoderResult::~CBC_CommonDecoderResult() {
62 delete m_other; 62 delete m_other;
63 } 63 }
64 const CFX_ByteArray& CBC_CommonDecoderResult::GetRawBytes() { 64 const CFX_ByteArray& CBC_CommonDecoderResult::GetRawBytes() {
65 return m_rawBytes; 65 return m_rawBytes;
66 } 66 }
67 const CFX_Int32Array& CBC_CommonDecoderResult::GetByteSegments() { 67 const CFX_Int32Array& CBC_CommonDecoderResult::GetByteSegments() {
68 return m_byteSegments; 68 return m_byteSegments;
69 } 69 }
70 const CFX_ByteString& CBC_CommonDecoderResult::GetText() { 70 const CFX_ByteString& CBC_CommonDecoderResult::GetText() {
71 return m_text; 71 return m_text;
72 } 72 }
73 CBC_QRCoderErrorCorrectionLevel* CBC_CommonDecoderResult::GetECLevel() { 73 CBC_QRCoderErrorCorrectionLevel* CBC_CommonDecoderResult::GetECLevel() {
74 return m_ecLevel; 74 return m_ecLevel;
75 } 75 }
OLDNEW
« no previous file with comments | « xfa/fxbarcode/common/BC_CommonCharacterSetECI.cpp ('k') | xfa/fxbarcode/common/BC_CommonECI.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698