From 524fa626d71efeb2164c82d565f17f077035b7df Mon Sep 17 00:00:00 2001 From: weili Date: Mon, 23 May 2016 10:38:07 -0700 Subject: Clean up more XFA code which causes warnings This is part of efforts to bring XFA to chromium_code standard. Most of them will have behavior change. The details of these problems are: xfa/fgas/layout/fgas_rtfbreak.cpp: Wrong condition with misused variable xfa/fgas/localization/fgas_locale.cpp Unnecessary condition xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp xfa/fxfa/app/xfa_fffield.cpp Unreachable code should be the correct code xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp xfa/fxbarcode/qrcode/BC_QRDetector.cpp Wrong condition logic BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2000073003 --- xfa/fxbarcode/qrcode/BC_QRDetector.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xfa/fxbarcode/qrcode') diff --git a/xfa/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/fxbarcode/qrcode/BC_QRDetector.cpp index 15ae3e26f1..35915cd673 100644 --- a/xfa/fxbarcode/qrcode/BC_QRDetector.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRDetector.cpp @@ -56,17 +56,17 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo( CalculateModuleSize(topLeft.get(), topRight.get(), bottomLeft.get()); if (moduleSize < 1.0f) { e = BCExceptionRead; - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + return nullptr; } int32_t dimension = ComputeDimension(topLeft.get(), topRight.get(), bottomLeft.get(), moduleSize, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); CBC_QRCoderVersion* provisionalVersion = CBC_QRCoderVersion::GetProvisionalVersionForDimension(dimension, e); - BC_EXCEPTION_CHECK_ReturnValue(e, NULL); + BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); int32_t modulesBetweenFPCenters = provisionalVersion->GetDimensionForVersion() - 7; - CBC_QRAlignmentPattern* alignmentPattern = NULL; + CBC_QRAlignmentPattern* alignmentPattern = nullptr; if (provisionalVersion->GetAlignmentPatternCenters()->GetSize() > 0) { FX_FLOAT bottomRightX = topRight->GetX() - topLeft->GetX() + bottomLeft->GetX(); @@ -83,8 +83,10 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo( for (int32_t i = 4; i <= 16; i <<= 1) { CBC_QRAlignmentPattern* temp = FindAlignmentInRegion( moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT)i, e); - alignmentPattern = temp; - break; + if (temp) { + alignmentPattern = temp; + break; + } } } CBC_CommonBitMatrix* bits = -- cgit v1.2.3