From ae51c810a44844ef437393c1768be8f7766586b2 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 5 Aug 2015 12:34:06 -0700 Subject: Kill off last uses of FX_NEW in XFA. It would seem that this never merged completely. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1277583002 . --- xfa/src/fxbarcode/pdf417/BC_PDF417.cpp | 8 +++--- .../fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 2 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp | 2 +- xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp | 32 +++++++++++----------- .../fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp | 2 +- .../pdf417/BC_PDF417DecodedBitStreamParser.cpp | 4 +-- .../pdf417/BC_PDF417DetectionResultColumn.cpp | 2 +- .../BC_PDF417DetectionResultRowIndicatorColumn.cpp | 4 +-- xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp | 26 +++++++++--------- .../pdf417/BC_PDF417ECErrorCorrection.cpp | 10 +++---- xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp | 10 +++---- .../fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp | 30 ++++++++++---------- .../fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp | 24 ++++++++-------- 13 files changed, 78 insertions(+), 78 deletions(-) (limited to 'xfa/src/fxbarcode/pdf417') diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp index c31ebf61e1..f38758f4bc 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp @@ -445,7 +445,7 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, dataCodewords, errorCorrectionLevel, e); BC_EXCEPTION_CHECK_ReturnVoid(e); CFX_WideString fullCodewords = dataCodewords + ec; - m_barcodeMatrix = FX_NEW CBC_BarcodeMatrix(rows, cols); + m_barcodeMatrix = new CBC_BarcodeMatrix(rows, cols); encodeLowLevel(fullCodewords, cols, rows, errorCorrectionLevel, m_barcodeMatrix); } @@ -561,7 +561,7 @@ CFX_Int32Array* CBC_PDF417::determineDimensions( if (dimension) { delete dimension; } - dimension = FX_NEW CFX_Int32Array; + dimension = new CFX_Int32Array; dimension->Add(cols); dimension->Add(rows); } @@ -569,11 +569,11 @@ CFX_Int32Array* CBC_PDF417::determineDimensions( int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols); if (rows < m_minRows) { - dimension = FX_NEW CFX_Int32Array; + dimension = new CFX_Int32Array; dimension->Add(m_minCols); dimension->Add(m_minRows); } else if (rows >= 3 && rows <= 90) { - dimension = FX_NEW CFX_Int32Array; + dimension = new CFX_Int32Array; dimension->Add(m_minCols); dimension->Add(rows); } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index 583a86e596..2386ba4e2e 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -27,7 +27,7 @@ CBC_BarcodeMatrix::CBC_BarcodeMatrix(int32_t height, int32_t width) { m_matrix.SetSize(height + 2); for (int32_t i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength; i++) { - m_matrix[i] = FX_NEW CBC_BarcodeRow((width + 4) * 17 + 1); + m_matrix[i] = new CBC_BarcodeRow((width + 4) * 17 + 1); } m_width = width * 17; m_height = height + 2; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp index 5397c4f36f..2bb3c45a18 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp @@ -40,7 +40,7 @@ void CBC_BarcodeValue::setValue(int32_t value) { } CFX_Int32Array* CBC_BarcodeValue::getValue() { int32_t maxConfidence = -1; - CFX_Int32Array* result = FX_NEW CFX_Int32Array; + CFX_Int32Array* result = new CFX_Int32Array; for (int32_t i = 0; i < m_keys.GetSize(); i++) { if (m_values.GetAt(i) > maxConfidence) { maxConfidence = m_values.GetAt(i); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp index 0801bbcd11..8aef43f989 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp @@ -61,14 +61,14 @@ CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, int32_t& e) { CBC_BoundingBox* boundingBox = NULL; if (leftBox == NULL) { - boundingBox = FX_NEW CBC_BoundingBox(rightBox); + boundingBox = new CBC_BoundingBox(rightBox); return boundingBox; } if (rightBox == NULL) { - boundingBox = FX_NEW CBC_BoundingBox(leftBox); + boundingBox = new CBC_BoundingBox(leftBox); return boundingBox; } - boundingBox = FX_NEW CBC_BoundingBox( + 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); @@ -90,7 +90,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(int32_t missingStartRows, if (newMinY < 0) { newMinY = 0; } - newTop = FX_NEW CBC_ResultPoint((FX_FLOAT)top->GetX(), (FX_FLOAT)newMinY); + newTop = new CBC_ResultPoint((FX_FLOAT)top->GetX(), (FX_FLOAT)newMinY); if (isLeft) { newTopLeft = newTop; } else { @@ -104,7 +104,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(int32_t missingStartRows, newMaxY = m_image->GetHeight() - 1; } newBottom = - FX_NEW CBC_ResultPoint((FX_FLOAT)bottom->GetX(), (FX_FLOAT)newMaxY); + new CBC_ResultPoint((FX_FLOAT)bottom->GetX(), (FX_FLOAT)newMaxY); if (isLeft) { newBottomLeft = newBottom; } else { @@ -112,7 +112,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(int32_t missingStartRows, } } calculateMinMaxValues(); - CBC_BoundingBox* boundingBox = FX_NEW CBC_BoundingBox( + CBC_BoundingBox* boundingBox = new CBC_BoundingBox( m_image, newTopLeft, newBottomLeft, newTopRight, newBottomRight, e); delete newTop; delete newBottom; @@ -123,7 +123,7 @@ void CBC_BoundingBox::setTopRight(CBC_ResultPoint topRight) { if (m_topRight) { delete m_topRight; } - m_topRight = FX_NEW CBC_ResultPoint(topRight.GetX(), topRight.GetY()); + m_topRight = new CBC_ResultPoint(topRight.GetX(), topRight.GetY()); calculateMinMaxValues(); } void CBC_BoundingBox::setBottomRight(CBC_ResultPoint bottomRight) { @@ -131,7 +131,7 @@ void CBC_BoundingBox::setBottomRight(CBC_ResultPoint bottomRight) { delete m_bottomRight; } m_bottomRight = - FX_NEW CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY()); + new CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY()); calculateMinMaxValues(); } int32_t CBC_BoundingBox::getMinX() { @@ -169,29 +169,29 @@ void CBC_BoundingBox::init(CBC_CommonBitMatrix* image, m_bottomRight = NULL; m_image = image; if (topLeft) { - m_topLeft = FX_NEW CBC_ResultPoint(topLeft->GetX(), topLeft->GetY()); + m_topLeft = new CBC_ResultPoint(topLeft->GetX(), topLeft->GetY()); } if (bottomLeft) { m_bottomLeft = - FX_NEW CBC_ResultPoint(bottomLeft->GetX(), bottomLeft->GetY()); + new CBC_ResultPoint(bottomLeft->GetX(), bottomLeft->GetY()); } if (topRight) { - m_topRight = FX_NEW CBC_ResultPoint(topRight->GetX(), topRight->GetY()); + m_topRight = new CBC_ResultPoint(topRight->GetX(), topRight->GetY()); } if (bottomRight) { m_bottomRight = - FX_NEW CBC_ResultPoint(bottomRight->GetX(), bottomRight->GetY()); + new CBC_ResultPoint(bottomRight->GetX(), bottomRight->GetY()); } calculateMinMaxValues(); } void CBC_BoundingBox::calculateMinMaxValues() { if (m_topLeft == NULL) { - m_topLeft = FX_NEW CBC_ResultPoint(0, m_topRight->GetY()); - m_bottomLeft = FX_NEW CBC_ResultPoint(0, m_bottomRight->GetY()); + m_topLeft = new CBC_ResultPoint(0, m_topRight->GetY()); + m_bottomLeft = new CBC_ResultPoint(0, m_bottomRight->GetY()); } else if (m_topRight == NULL) { - m_topRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, + m_topRight = new CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_topLeft->GetY()); - m_bottomRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, + m_bottomRight = new CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_bottomLeft->GetY()); } m_minX = (int32_t)(m_topLeft->GetX() < m_bottomLeft->GetX() diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp index 6e7d26b4af..d70dbb12e4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp @@ -59,7 +59,7 @@ CFX_Int32Array* CBC_PDF417CodewordDecoder::sampleBitCounts( CFX_Int32Array& moduleBitCount) { FX_FLOAT bitCountSum = (FX_FLOAT)CBC_PDF417Common::getBitCountSum(moduleBitCount); - CFX_Int32Array* bitCount = FX_NEW CFX_Int32Array(); + CFX_Int32Array* bitCount = new CFX_Int32Array(); bitCount->SetSize(CBC_PDF417Common::BARS_IN_MODULE); int32_t bitCountIndex = 0; int32_t sumPreviousBits = 0; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp index 5002a991fd..e14b2b37c4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp @@ -64,7 +64,7 @@ CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode( int32_t codeIndex = 1; int32_t code = codewords.GetAt(codeIndex); codeIndex++; - CBC_PDF417ResultMetadata* resultMetadata = FX_NEW CBC_PDF417ResultMetadata; + CBC_PDF417ResultMetadata* resultMetadata = new CBC_PDF417ResultMetadata; while (codeIndex < codewords[0]) { switch (code) { case TEXT_COMPACTION_MODE_LATCH: @@ -110,7 +110,7 @@ CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode( } CFX_ByteArray rawBytes; CFX_PtrArray byteSegments; - CBC_CommonDecoderResult* tempCd = FX_NEW CBC_CommonDecoderResult(); + CBC_CommonDecoderResult* tempCd = new CBC_CommonDecoderResult(); tempCd->Init(rawBytes, result, byteSegments, ecLevel, e); if (e != BCExceptionNO) { delete resultMetadata; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp index d58220fa3a..9252c33011 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp @@ -28,7 +28,7 @@ int32_t CBC_DetectionResultColumn::MAX_NEARBY_DISTANCE = 5; CBC_DetectionResultColumn::CBC_DetectionResultColumn( CBC_BoundingBox* boundingBox) { m_boundingBox = boundingBox; - m_codewords = FX_NEW CFX_PtrArray; + m_codewords = new CFX_PtrArray; m_codewords->SetSize(boundingBox->getMaxY() - boundingBox->getMinY() + 1); } CBC_DetectionResultColumn::~CBC_DetectionResultColumn() { diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp index 843e8a90a5..bc3fb4c9bd 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp @@ -113,7 +113,7 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights( return NULL; } adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata); - CFX_Int32Array* result = FX_NEW CFX_Int32Array; + CFX_Int32Array* result = new CFX_Int32Array; result->SetSize(barcodeMetadata->getRowCount()); for (int32_t i = 0; i < getCodewords()->GetSize(); i++) { CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i); @@ -209,7 +209,7 @@ CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() { return NULL; } CBC_BarcodeMetadata* barcodeMetadata = - FX_NEW CBC_BarcodeMetadata(barcodeColumnCount.getValue()->GetAt(0), + new CBC_BarcodeMetadata(barcodeColumnCount.getValue()->GetAt(0), barcodeRowCountUpperPart.getValue()->GetAt(0), barcodeRowCountLowerPart.getValue()->GetAt(0), barcodeECLevel.getValue()->GetAt(0)); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp index 24ef935430..7f3940d101 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp @@ -62,15 +62,15 @@ CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CBC_PDF417DetectorResult* detectorResult = - FX_NEW CBC_PDF417DetectorResult(bitMatrix, barcodeCoordinates); + new CBC_PDF417DetectorResult(bitMatrix, barcodeCoordinates); return detectorResult; } void CBC_Detector::rotate180(CBC_CommonBitMatrix* bitMatrix) { int32_t width = bitMatrix->GetWidth(); int32_t height = bitMatrix->GetHeight(); - CBC_CommonBitArray* firstRowBitArray = FX_NEW CBC_CommonBitArray(width); - CBC_CommonBitArray* secondRowBitArray = FX_NEW CBC_CommonBitArray(width); - CBC_CommonBitArray* tmpBitArray = FX_NEW CBC_CommonBitArray(width); + CBC_CommonBitArray* firstRowBitArray = new CBC_CommonBitArray(width); + CBC_CommonBitArray* secondRowBitArray = new CBC_CommonBitArray(width); + CBC_CommonBitArray* tmpBitArray = new CBC_CommonBitArray(width); for (int32_t y = 0; y<(height + 1)>> 1; y++) { CBC_CommonBitArray* temp = bitMatrix->GetRow(height - 1 - y, secondRowBitArray); @@ -91,7 +91,7 @@ void CBC_Detector::rotate180(CBC_CommonBitMatrix* bitMatrix) { } CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, CBC_CommonBitArray* result) { - CBC_CommonBitArray* array = FX_NEW CBC_CommonBitArray(result->GetSize()); + CBC_CommonBitArray* array = new CBC_CommonBitArray(result->GetSize()); array->Clear(); int32_t size = input->GetSize(); for (int32_t i = 0; i < size; i++) { @@ -103,7 +103,7 @@ CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, } CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix) { - CFX_PtrArray* barcodeCoordinates = FX_NEW CFX_PtrArray; + CFX_PtrArray* barcodeCoordinates = new CFX_PtrArray; int32_t row = 0; int32_t column = 0; FX_BOOL foundBarcodeInRow = FALSE; @@ -154,7 +154,7 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, int32_t startColumn) { int32_t height = matrix->GetHeight(); int32_t width = matrix->GetWidth(); - CFX_PtrArray* result = FX_NEW CFX_PtrArray; + CFX_PtrArray* result = new CFX_PtrArray; result->SetSize(8); CFX_PtrArray* startptr = findRowsWithPattern( matrix, height, width, startRow, startColumn, START_PATTERN, @@ -192,7 +192,7 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_t startColumn, int32_t* pattern, int32_t patternLength) { - CFX_PtrArray* result = FX_NEW CFX_PtrArray; + CFX_PtrArray* result = new CFX_PtrArray; result->SetSize(4); FX_BOOL found = FALSE; CFX_Int32Array counters; @@ -214,9 +214,9 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, break; } } - result->SetAt(0, FX_NEW CBC_ResultPoint((FX_FLOAT)loc->GetAt(0), + result->SetAt(0, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(0), (FX_FLOAT)startRow)); - result->SetAt(1, FX_NEW CBC_ResultPoint((FX_FLOAT)loc->GetAt(1), + result->SetAt(1, new CBC_ResultPoint((FX_FLOAT)loc->GetAt(1), (FX_FLOAT)startRow)); found = TRUE; delete loc; @@ -249,9 +249,9 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, delete loc; } stopRow -= skippedRowCount + 1; - result->SetAt(2, FX_NEW CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(0), + result->SetAt(2, new CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(0), (FX_FLOAT)stopRow)); - result->SetAt(3, FX_NEW CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(1), + result->SetAt(3, new CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(1), (FX_FLOAT)stopRow)); } if (stopRow - startRow < BARCODE_MIN_HEIGHT) { @@ -275,7 +275,7 @@ CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_BOOL isWhite = whiteFirst; int32_t patternStart = column; int32_t pixelDrift = 0; - CFX_Int32Array* intarray = FX_NEW CFX_Int32Array; + CFX_Int32Array* intarray = new CFX_Int32Array; while (matrix->Get(patternStart, row) && patternStart > 0 && pixelDrift++ < MAX_PIXEL_DRIFT) { patternStart--; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp index 344e4b8d5b..a0d8b697d0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp @@ -28,7 +28,7 @@ CBC_PDF417ECModulusGF* CBC_PDF417ECErrorCorrection::m_field = NULL; void CBC_PDF417ECErrorCorrection::Initialize(int32_t& e) { m_field = - FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); + new CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); } void CBC_PDF417ECErrorCorrection::Finalize() { delete m_field; @@ -55,7 +55,7 @@ int32_t CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array& received, return 0; } CBC_PDF417ECModulusPoly* syndrome = - FX_NEW CBC_PDF417ECModulusPoly(m_field, S, e); + new CBC_PDF417ECModulusPoly(m_field, S, e); BC_EXCEPTION_CHECK_ReturnValue(e, -1); CBC_PDF417ECModulusPoly* buildmonomial = m_field->buildMonomial(numECCodewords, 1, e); @@ -321,7 +321,7 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm( delete rtemp; } BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - CFX_PtrArray* modulusPoly = FX_NEW CFX_PtrArray; + CFX_PtrArray* modulusPoly = new CFX_PtrArray; modulusPoly->Add(sigma); modulusPoly->Add(omega); return modulusPoly; @@ -330,7 +330,7 @@ CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations( CBC_PDF417ECModulusPoly* errorLocator, int32_t& e) { int32_t numErrors = errorLocator->getDegree(); - CFX_Int32Array* result = FX_NEW CFX_Int32Array; + CFX_Int32Array* result = new CFX_Int32Array; result->SetSize(numErrors); int32_t ee = 0; for (int32_t i = 1; i < m_field->getSize() && ee < numErrors; i++) { @@ -366,7 +366,7 @@ CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorMagnitudes( formalDerivativeCoefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); int32_t s = errorLocations.GetSize(); - CFX_Int32Array* result = FX_NEW CFX_Int32Array; + CFX_Int32Array* result = new CFX_Int32Array; result->SetSize(s); for (int32_t i = 0; i < s; i++) { int32_t xiInverse = m_field->inverse(errorLocations[i], e); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp index 029a5e5946..6f3462cb1c 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp @@ -27,7 +27,7 @@ CBC_PDF417ECModulusGF* CBC_PDF417ECModulusGF::PDF417_GF = NULL; void CBC_PDF417ECModulusGF::Initialize(int32_t& e) { PDF417_GF = - FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); + new CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); } void CBC_PDF417ECModulusGF::Finalize() { delete PDF417_GF; @@ -48,10 +48,10 @@ CBC_PDF417ECModulusGF::CBC_PDF417ECModulusGF(int32_t modulus, } CFX_Int32Array zero; zero.Add(0); - m_zero = FX_NEW CBC_PDF417ECModulusPoly(this, zero, e); + m_zero = new CBC_PDF417ECModulusPoly(this, zero, e); CFX_Int32Array one; one.Add(1); - m_one = FX_NEW CBC_PDF417ECModulusPoly(this, one, e); + m_one = new CBC_PDF417ECModulusPoly(this, one, e); } CBC_PDF417ECModulusGF::~CBC_PDF417ECModulusGF() { delete m_zero; @@ -73,7 +73,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial( } CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (coefficient == 0) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_zero->getField(), + modulusPoly = new CBC_PDF417ECModulusPoly(m_zero->getField(), m_zero->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; @@ -81,7 +81,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial( CFX_Int32Array coefficients; coefficients.SetSize(degree + 1); coefficients[0] = coefficient; - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(this, coefficients, e); + modulusPoly = new CBC_PDF417ECModulusPoly(this, coefficients, 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 f05a4a05fc..423a70029e 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp @@ -93,13 +93,13 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add( int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero()) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(other->getField(), + modulusPoly = new CBC_PDF417ECModulusPoly(other->getField(), other->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } if (other->isZero()) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -124,7 +124,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add( sumDiff[i] = m_field->add(smallerCoefficients[i - lengthDiff], largerCoefficients[i]); } - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, sumDiff, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, sumDiff, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -133,7 +133,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract( int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (other->isZero()) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -149,7 +149,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply( int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero() || other->isZero()) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly( + modulusPoly = new CBC_PDF417ECModulusPoly( m_field->getZero()->getField(), m_field->getZero()->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -170,7 +170,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply( product[i + j], m_field->multiply(aCoeff, bCoefficients[j])); } } - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, product, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -182,7 +182,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::negative(int32_t& e) { negativeCoefficients[i] = m_field->subtract(0, m_coefficients[i]); } CBC_PDF417ECModulusPoly* modulusPoly = - FX_NEW CBC_PDF417ECModulusPoly(m_field, negativeCoefficients, e); + new CBC_PDF417ECModulusPoly(m_field, negativeCoefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -190,14 +190,14 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(int32_t scalar, int32_t& e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (scalar == 0) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly( + modulusPoly = new CBC_PDF417ECModulusPoly( m_field->getZero()->getField(), m_field->getZero()->getCoefficients(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } if (scalar == 1) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -207,7 +207,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(int32_t scalar, for (int32_t i = 0; i < size; i++) { product[i] = m_field->multiply(m_coefficients[i], scalar); } - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, product, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -221,7 +221,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial( } CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (coefficient == 0) { - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly( + modulusPoly = new CBC_PDF417ECModulusPoly( m_field->getZero()->m_field, m_field->getZero()->m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; @@ -232,7 +232,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial( for (int32_t i = 0; i < size; i++) { product[i] = m_field->multiply(m_coefficients[i], coefficient); } - modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e); + modulusPoly = new CBC_PDF417ECModulusPoly(m_field, product, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } @@ -242,11 +242,11 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, e = BCExceptionDivideByZero; return NULL; } - CBC_PDF417ECModulusPoly* quotient = FX_NEW CBC_PDF417ECModulusPoly( + CBC_PDF417ECModulusPoly* quotient = new CBC_PDF417ECModulusPoly( m_field->getZero()->m_field, m_field->getZero()->m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_PDF417ECModulusPoly* remainder = - FX_NEW CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); + new CBC_PDF417ECModulusPoly(m_field, m_coefficients, e); if (e != BCExceptionNO) { delete quotient; return NULL; @@ -296,7 +296,7 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, return NULL; } } - CFX_PtrArray* modulusPoly = FX_NEW CFX_PtrArray; + CFX_PtrArray* modulusPoly = new CFX_PtrArray; modulusPoly->Add(quotient); modulusPoly->Add(remainder); return modulusPoly; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp index 781fdb81d0..7427b311c9 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp @@ -47,7 +47,7 @@ CBC_PDF417ECErrorCorrection* CBC_PDF417ScanningDecoder::errorCorrection = NULL; CBC_PDF417ScanningDecoder::CBC_PDF417ScanningDecoder() {} CBC_PDF417ScanningDecoder::~CBC_PDF417ScanningDecoder() {} void CBC_PDF417ScanningDecoder::Initialize() { - errorCorrection = FX_NEW CBC_PDF417ECErrorCorrection; + errorCorrection = new CBC_PDF417ECErrorCorrection; } void CBC_PDF417ScanningDecoder::Finalize() { delete errorCorrection; @@ -61,7 +61,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode( int32_t minCodewordWidth, int32_t maxCodewordWidth, int32_t& e) { - CBC_BoundingBox* boundingBox = FX_NEW CBC_BoundingBox( + CBC_BoundingBox* boundingBox = new CBC_BoundingBox( image, imageTopLeft, imageBottomLeft, imageTopRight, imageBottomRight, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn = NULL; @@ -111,10 +111,10 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode( } CBC_DetectionResultColumn* detectionResultColumn = NULL; if (barcodeColumn == 0 || barcodeColumn == maxBarcodeColumn) { - detectionResultColumn = FX_NEW CBC_DetectionResultRowIndicatorColumn( + detectionResultColumn = new CBC_DetectionResultRowIndicatorColumn( boundingBox, barcodeColumn == 0); } else { - detectionResultColumn = FX_NEW CBC_DetectionResultColumn(boundingBox); + detectionResultColumn = new CBC_DetectionResultColumn(boundingBox); } detectionResult->setDetectionResultColumn(barcodeColumn, detectionResultColumn); @@ -207,7 +207,7 @@ CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge( return NULL; } CBC_DetectionResult* detectionresult = - FX_NEW CBC_DetectionResult(barcodeMetadata, boundingBox); + new CBC_DetectionResult(barcodeMetadata, boundingBox); return detectionresult; } CBC_BoundingBox* CBC_PDF417ScanningDecoder::adjustBoundingBox( @@ -297,7 +297,7 @@ CBC_PDF417ScanningDecoder::getRowIndicatorColumn(CBC_CommonBitMatrix* image, int32_t minCodewordWidth, int32_t maxCodewordWidth) { CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn = - FX_NEW CBC_DetectionResultRowIndicatorColumn(boundingBox, leftToRight); + new CBC_DetectionResultRowIndicatorColumn(boundingBox, leftToRight); for (int32_t i = 0; i < 2; i++) { int32_t increment = i == 0 ? 1 : -1; int32_t startColumn = (int32_t)startPoint.GetX(); @@ -459,16 +459,16 @@ CBC_PDF417ScanningDecoder::createDecoderResultFromAmbiguousValues( } CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix( CBC_DetectionResult* detectionResult) { - CFX_PtrArray* barcodeMatrix = FX_NEW CFX_PtrArray; + CFX_PtrArray* barcodeMatrix = new CFX_PtrArray; barcodeMatrix->SetSize(detectionResult->getBarcodeRowCount()); CFX_PtrArray* temp = NULL; int32_t colume = 0; for (int32_t row = 0; row < barcodeMatrix->GetSize(); row++) { - temp = FX_NEW CFX_PtrArray; + temp = new CFX_PtrArray; temp->SetSize(detectionResult->getBarcodeColumnCount() + 2); for (colume = 0; colume < detectionResult->getBarcodeColumnCount() + 2; colume++) { - temp->SetAt(colume, FX_NEW CBC_BarcodeValue()); + temp->SetAt(colume, new CBC_BarcodeValue()); } barcodeMatrix->SetAt(row, temp); } @@ -590,7 +590,7 @@ CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword( if (codeword == -1) { return NULL; } - return FX_NEW CBC_Codeword(startColumn, endColumn, + return new CBC_Codeword(startColumn, endColumn, getCodewordBucketNumber(decodedValue), codeword); } CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount( @@ -601,7 +601,7 @@ CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount( int32_t startColumn, int32_t imageRow) { int32_t imageColumn = startColumn; - CFX_Int32Array* moduleBitCount = FX_NEW CFX_Int32Array; + CFX_Int32Array* moduleBitCount = new CFX_Int32Array; moduleBitCount->SetSize(8); int32_t moduleNumber = 0; int32_t increment = leftToRight ? 1 : -1; @@ -721,7 +721,7 @@ void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array& codewords, } CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword( int32_t codeword) { - CFX_Int32Array* result = FX_NEW CFX_Int32Array; + CFX_Int32Array* result = new CFX_Int32Array; result->SetSize(8); int32_t previousValue = 0; int32_t i = result->GetSize() - 1; -- cgit v1.2.3