summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
commit38eaaf36b09b816b963015e33dc4eb02580e0462 (patch)
tree9a2721eb404a2de4ddce91b50cac25b2cac0edb1 /xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
parente1fb98394a6885cf03bdc6391e5a3878aad5b375 (diff)
downloadpdfium-38eaaf36b09b816b963015e33dc4eb02580e0462.tar.xz
Remove foo != NULL checks in xfa/src/fxbarcode.
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1726373002 .
Diffstat (limited to 'xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp')
-rw-r--r--xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
index 8090c79975..820b15e91d 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp
@@ -70,12 +70,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn = NULL;
CBC_DetectionResult* detectionResult = NULL;
for (int32_t i = 0; i < 2; i++) {
- if (imageTopLeft != NULL) {
+ if (imageTopLeft) {
leftRowIndicatorColumn =
getRowIndicatorColumn(image, boundingBox, *imageTopLeft, TRUE,
minCodewordWidth, maxCodewordWidth);
}
- if (imageTopRight != NULL) {
+ if (imageTopRight) {
rightRowIndicatorColumn =
getRowIndicatorColumn(image, boundingBox, *imageTopRight, FALSE,
minCodewordWidth, maxCodewordWidth);
@@ -108,7 +108,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
barcodeColumnCount++) {
int32_t barcodeColumn = leftToRight ? barcodeColumnCount
: maxBarcodeColumn - barcodeColumnCount;
- if (detectionResult->getDetectionResultColumn(barcodeColumn) != NULL) {
+ if (detectionResult->getDetectionResultColumn(barcodeColumn)) {
continue;
}
CBC_DetectionResultColumn* detectionResultColumn = NULL;
@@ -135,7 +135,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(
CBC_Codeword* codeword = detectCodeword(
image, boundingBox->getMinX(), boundingBox->getMaxX(), leftToRight,
startColumn, imageRow, minCodewordWidth, maxCodewordWidth);
- if (codeword != NULL) {
+ if (codeword) {
detectionResultColumn->setCodeword(imageRow, codeword);
previousStartColumn = startColumn;
minCodewordWidth = minCodewordWidth < codeword->getWidth()
@@ -310,7 +310,7 @@ CBC_PDF417ScanningDecoder::getRowIndicatorColumn(CBC_CommonBitMatrix* image,
CBC_Codeword* codeword =
detectCodeword(image, 0, image->GetWidth(), leftToRight, startColumn,
imageRow, minCodewordWidth, maxCodewordWidth);
- if (codeword != NULL) {
+ if (codeword) {
rowIndicatorColumn->setCodeword(imageRow, codeword);
if (leftToRight) {
startColumn = codeword->getStartX();
@@ -515,19 +515,19 @@ int32_t CBC_PDF417ScanningDecoder::getStartColumn(
codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)
->getCodeword(imageRow);
}
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getEndX() : codeword->getStartX();
}
codeword = detectionResult->getDetectionResultColumn(barcodeColumn)
->getCodewordNearby(imageRow);
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getStartX() : codeword->getEndX();
}
if (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) {
codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)
->getCodewordNearby(imageRow);
}
- if (codeword != NULL) {
+ if (codeword) {
return leftToRight ? codeword->getEndX() : codeword->getStartX();
}
int32_t skippedColumns = 0;
@@ -543,7 +543,7 @@ int32_t CBC_PDF417ScanningDecoder::getStartColumn(
barcodeColumn)
->getCodewords()
->GetAt(i);
- if (previousRowCodeword != NULL) {
+ if (previousRowCodeword) {
return (leftToRight ? previousRowCodeword->getEndX()
: previousRowCodeword->getStartX()) +
offset * skippedColumns * (previousRowCodeword->getEndX() -