summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-09 18:39:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-09 18:39:33 -0700
commit6dc1d7753691c0ff2f390e8ffd95a3182064487e (patch)
tree43d77664973a76c107832ae7b3c3e0f04bba1fe0 /xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
parentfcf61b39ee597c73e80ba789833fb7fe49878422 (diff)
downloadpdfium-6dc1d7753691c0ff2f390e8ffd95a3182064487e.tar.xz
Get rid of NULLs in xfa/fxbarcode/
Review-Url: https://codereview.chromium.org/2048983002
Diffstat (limited to 'xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
index 79754b020e..931a83163c 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp
@@ -122,9 +122,9 @@ int32_t CBC_DetectionResult::adjustRowNumbers() {
m_detectionResultColumns[barcodeColumn]->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
if (!codewords->GetAt(codewordsRow)->hasValidRowNumber()) {
adjustRowNumbers(barcodeColumn, codewordsRow, codewords);
}
@@ -180,9 +180,9 @@ int32_t CBC_DetectionResult::adjustRowNumbersFromRRI() {
m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1)->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
int32_t rowIndicatorRowNumber =
codewords->GetAt(codewordsRow)->getRowNumber();
int32_t invalidRowCounts = 0;
@@ -204,17 +204,17 @@ int32_t CBC_DetectionResult::adjustRowNumbersFromRRI() {
return unadjustedCount;
}
int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() {
- if (m_detectionResultColumns[0] == NULL) {
+ if (!m_detectionResultColumns[0])
return 0;
- }
+
int32_t unadjustedCount = 0;
CFX_ArrayTemplate<CBC_Codeword*>* codewords =
m_detectionResultColumns.GetAt(0)->getCodewords();
for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize();
codewordsRow++) {
- if (codewords->GetAt(codewordsRow) == NULL) {
+ if (!codewords->GetAt(codewordsRow))
continue;
- }
+
int32_t rowIndicatorRowNumber =
codewords->GetAt(codewordsRow)->getRowNumber();
int32_t invalidRowCounts = 0;
@@ -239,9 +239,9 @@ int32_t CBC_DetectionResult::adjustRowNumberIfValid(
int32_t rowIndicatorRowNumber,
int32_t invalidRowCounts,
CBC_Codeword* codeword) {
- if (codeword == NULL) {
+ if (!codeword)
return invalidRowCounts;
- }
+
if (!codeword->hasValidRowNumber()) {
if (codeword->isValidRowNumber(rowIndicatorRowNumber)) {
codeword->setRowNumber(rowIndicatorRowNumber);
@@ -298,9 +298,9 @@ void CBC_DetectionResult::adjustRowNumbers(
}
FX_BOOL CBC_DetectionResult::adjustRowNumber(CBC_Codeword* codeword,
CBC_Codeword* otherCodeword) {
- if (otherCodeword == NULL) {
+ if (!otherCodeword)
return FALSE;
- }
+
if (otherCodeword->hasValidRowNumber() &&
otherCodeword->getBucket() == codeword->getBucket()) {
codeword->setRowNumber(otherCodeword->getRowNumber());