From 077f1a335560a8014e466c768c1e9d24c8a61ac9 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 6 Aug 2015 15:08:57 -0700 Subject: XFA: clang-format all pdfium code, again. Also add a presubmit that checks for this so I don't have to keep doing it. No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=thestig@chromium.org Review URL: https://codereview.chromium.org/1277043002 . --- xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp | 16 +++++++--------- .../BC_PDF417DetectionResultRowIndicatorColumn.cpp | 6 +++--- xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp | 12 ++++++------ xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp | 2 +- xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp | 14 +++++++------- xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp | 2 +- 6 files changed, 25 insertions(+), 27 deletions(-) (limited to 'xfa/src/fxbarcode/pdf417') diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp index 8aef43f989..c1a7394103 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp @@ -68,9 +68,9 @@ CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, boundingBox = new CBC_BoundingBox(leftBox); return boundingBox; } - boundingBox = new CBC_BoundingBox( - leftBox->m_image, leftBox->m_topLeft, leftBox->m_bottomLeft, - rightBox->m_topRight, rightBox->m_bottomRight, e); + boundingBox = new CBC_BoundingBox(leftBox->m_image, leftBox->m_topLeft, + leftBox->m_bottomLeft, rightBox->m_topRight, + rightBox->m_bottomRight, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return boundingBox; } @@ -130,8 +130,7 @@ void CBC_BoundingBox::setBottomRight(CBC_ResultPoint bottomRight) { if (m_bottomRight) { delete m_bottomRight; } - m_bottomRight = - new CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY()); + m_bottomRight = new CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY()); calculateMinMaxValues(); } int32_t CBC_BoundingBox::getMinX() { @@ -172,8 +171,7 @@ void CBC_BoundingBox::init(CBC_CommonBitMatrix* image, m_topLeft = new CBC_ResultPoint(topLeft->GetX(), topLeft->GetY()); } if (bottomLeft) { - m_bottomLeft = - new CBC_ResultPoint(bottomLeft->GetX(), bottomLeft->GetY()); + m_bottomLeft = new CBC_ResultPoint(bottomLeft->GetX(), bottomLeft->GetY()); } if (topRight) { m_topRight = new CBC_ResultPoint(topRight->GetX(), topRight->GetY()); @@ -190,9 +188,9 @@ void CBC_BoundingBox::calculateMinMaxValues() { m_bottomLeft = new CBC_ResultPoint(0, m_bottomRight->GetY()); } else if (m_topRight == NULL) { m_topRight = new CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, - (FX_FLOAT)m_topLeft->GetY()); + (FX_FLOAT)m_topLeft->GetY()); m_bottomRight = new CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, - (FX_FLOAT)m_bottomLeft->GetY()); + (FX_FLOAT)m_bottomLeft->GetY()); } m_minX = (int32_t)(m_topLeft->GetX() < m_bottomLeft->GetX() ? m_topLeft->GetX() diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp index bc3fb4c9bd..0a0067c758 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp @@ -210,9 +210,9 @@ CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() { } CBC_BarcodeMetadata* barcodeMetadata = new CBC_BarcodeMetadata(barcodeColumnCount.getValue()->GetAt(0), - barcodeRowCountUpperPart.getValue()->GetAt(0), - barcodeRowCountLowerPart.getValue()->GetAt(0), - barcodeECLevel.getValue()->GetAt(0)); + barcodeRowCountUpperPart.getValue()->GetAt(0), + barcodeRowCountLowerPart.getValue()->GetAt(0), + barcodeECLevel.getValue()->GetAt(0)); removeIncorrectCodewords(codewords, *barcodeMetadata); return barcodeMetadata; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp index 7f3940d101..3f0532ac4b 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp @@ -214,10 +214,10 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, break; } } - result->SetAt(0, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(0), - (FX_FLOAT)startRow)); - result->SetAt(1, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(1), - (FX_FLOAT)startRow)); + result->SetAt( + 0, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(0), (FX_FLOAT)startRow)); + result->SetAt( + 1, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(1), (FX_FLOAT)startRow)); found = TRUE; delete loc; break; @@ -250,9 +250,9 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, } stopRow -= skippedRowCount + 1; result->SetAt(2, new CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(0), - (FX_FLOAT)stopRow)); + (FX_FLOAT)stopRow)); result->SetAt(3, new CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(1), - (FX_FLOAT)stopRow)); + (FX_FLOAT)stopRow)); } if (stopRow - startRow < BARCODE_MIN_HEIGHT) { for (int32_t i = 0; i < result->GetSize(); i++) { diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp index 6f3462cb1c..d9952c64d1 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp @@ -74,7 +74,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial( CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (coefficient == 0) { modulusPoly = new CBC_PDF417ECModulusPoly(m_zero->getField(), - m_zero->getCoefficients(), e); + m_zero->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp index 423a70029e..2e06fdb7d7 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp @@ -94,7 +94,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add( CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero()) { modulusPoly = new CBC_PDF417ECModulusPoly(other->getField(), - other->getCoefficients(), e); + other->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -149,9 +149,9 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply( int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero() || other->isZero()) { - modulusPoly = new CBC_PDF417ECModulusPoly( - m_field->getZero()->getField(), m_field->getZero()->getCoefficients(), - e); + modulusPoly = + new CBC_PDF417ECModulusPoly(m_field->getZero()->getField(), + m_field->getZero()->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -190,9 +190,9 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(int32_t scalar, int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (scalar == 0) { - modulusPoly = new CBC_PDF417ECModulusPoly( - m_field->getZero()->getField(), m_field->getZero()->getCoefficients(), - e); + modulusPoly = + new CBC_PDF417ECModulusPoly(m_field->getZero()->getField(), + m_field->getZero()->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp index 7427b311c9..1c12c6402f 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp @@ -591,7 +591,7 @@ CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword( return NULL; } return new CBC_Codeword(startColumn, endColumn, - getCodewordBucketNumber(decodedValue), codeword); + getCodewordBucketNumber(decodedValue), codeword); } CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount( CBC_CommonBitMatrix* image, -- cgit v1.2.3