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

Side by Side Diff: xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.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 2013 ZXing authors 8 * Copyright 2013 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_BoundingBox* boundingBox, 33 CBC_BoundingBox* boundingBox,
34 FX_BOOL isLeft) 34 FX_BOOL isLeft)
35 : CBC_DetectionResultColumn(boundingBox) { 35 : CBC_DetectionResultColumn(boundingBox) {
36 m_isLeft = isLeft; 36 m_isLeft = isLeft;
37 } 37 }
38 CBC_DetectionResultRowIndicatorColumn:: 38 CBC_DetectionResultRowIndicatorColumn::
39 ~CBC_DetectionResultRowIndicatorColumn() {} 39 ~CBC_DetectionResultRowIndicatorColumn() {}
40 void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() { 40 void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() {
41 for (int32_t i = 0; i < m_codewords->GetSize(); i++) { 41 for (int32_t i = 0; i < m_codewords->GetSize(); i++) {
42 CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i); 42 CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i);
43 if (codeword != NULL) { 43 if (codeword) {
44 codeword->setRowNumberAsRowIndicatorColumn(); 44 codeword->setRowNumberAsRowIndicatorColumn();
45 } 45 }
46 } 46 }
47 } 47 }
48 int32_t 48 int32_t
49 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers( 49 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(
50 CBC_BarcodeMetadata barcodeMetadata) { 50 CBC_BarcodeMetadata barcodeMetadata) {
51 CFX_PtrArray* codewords = getCodewords(); 51 CFX_PtrArray* codewords = getCodewords();
52 setRowNumbers(); 52 setRowNumbers();
53 removeIncorrectCodewords(codewords, barcodeMetadata); 53 removeIncorrectCodewords(codewords, barcodeMetadata);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata(); 110 CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata();
111 if (barcodeMetadata == NULL) { 111 if (barcodeMetadata == NULL) {
112 e = BCExceptionCannotMetadata; 112 e = BCExceptionCannotMetadata;
113 return NULL; 113 return NULL;
114 } 114 }
115 adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata); 115 adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata);
116 CFX_Int32Array* result = new CFX_Int32Array; 116 CFX_Int32Array* result = new CFX_Int32Array;
117 result->SetSize(barcodeMetadata->getRowCount()); 117 result->SetSize(barcodeMetadata->getRowCount());
118 for (int32_t i = 0; i < getCodewords()->GetSize(); i++) { 118 for (int32_t i = 0; i < getCodewords()->GetSize(); i++) {
119 CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i); 119 CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i);
120 if (codeword != NULL) { 120 if (codeword) {
121 result->SetAt(codeword->getRowNumber(), 121 result->SetAt(codeword->getRowNumber(),
122 result->GetAt(codeword->getRowNumber()) + 1); 122 result->GetAt(codeword->getRowNumber()) + 1);
123 } 123 }
124 } 124 }
125 return result; 125 return result;
126 } 126 }
127 int32_t CBC_DetectionResultRowIndicatorColumn:: 127 int32_t CBC_DetectionResultRowIndicatorColumn::
128 adjustIncompleteIndicatorColumnRowNumbers( 128 adjustIncompleteIndicatorColumnRowNumbers(
129 CBC_BarcodeMetadata barcodeMetadata) { 129 CBC_BarcodeMetadata barcodeMetadata) {
130 CBC_BoundingBox* boundingBox = getBoundingBox(); 130 CBC_BoundingBox* boundingBox = getBoundingBox();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 256 }
257 break; 257 break;
258 case 2: 258 case 2:
259 if (rowIndicatorValue + 1 != barcodeMetadata.getColumnCount()) { 259 if (rowIndicatorValue + 1 != barcodeMetadata.getColumnCount()) {
260 codewords->SetAt(codewordRow, NULL); 260 codewords->SetAt(codewordRow, NULL);
261 } 261 }
262 break; 262 break;
263 } 263 }
264 } 264 }
265 } 265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698