summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/common
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-08-05 12:34:06 -0700
committerTom Sepez <tsepez@chromium.org>2015-08-05 12:34:06 -0700
commitae51c810a44844ef437393c1768be8f7766586b2 (patch)
tree373bbfa8c8720af43d58a9982beea3ebf10c5d6d /xfa/src/fxbarcode/common
parente3166a8c39c8943f6cafb2ffe10bd9564e3eaf16 (diff)
downloadpdfium-ae51c810a44844ef437393c1768be8f7766586b2.tar.xz
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 .
Diffstat (limited to 'xfa/src/fxbarcode/common')
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp4
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp8
-rw-r--r--xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp4
-rw-r--r--xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp22
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp2
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp8
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp10
-rw-r--r--xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp12
8 files changed, 35 insertions, 35 deletions
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
index d5796d1263..0a0930d97c 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp
@@ -108,9 +108,9 @@ CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(int32_t y,
CBC_CommonBitArray* row) {
CBC_CommonBitArray* rowArray = NULL;
if (row == NULL || row->GetSize() < m_width) {
- rowArray = FX_NEW CBC_CommonBitArray(m_width);
+ rowArray = new CBC_CommonBitArray(m_width);
} else {
- rowArray = FX_NEW CBC_CommonBitArray(row);
+ rowArray = new CBC_CommonBitArray(row);
}
int32_t offset = y * m_rowSize;
int32_t x;
diff --git a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
index 498cca2dbb..50dd8fae5b 100644
--- a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
@@ -96,7 +96,7 @@ CBC_CommonPerspectiveTransform::SquareToQuadrilateral(FX_FLOAT x0,
FX_FLOAT dy2 = y3 - y2;
FX_FLOAT dy3 = y0 - y1 + y2 - y3;
if ((dy2 == 0.0f) && (dy3 == 0.0f)) {
- return FX_NEW CBC_CommonPerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0,
+ return new CBC_CommonPerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0,
y2 - y1, y0, 0.0f, 0.0f, 1.0f);
} else {
FX_FLOAT dx1 = x1 - x2;
@@ -106,7 +106,7 @@ CBC_CommonPerspectiveTransform::SquareToQuadrilateral(FX_FLOAT x0,
FX_FLOAT denominator = dx1 * dy2 - dx2 * dy1;
FX_FLOAT a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
FX_FLOAT a23 = (dx1 * dy3 - dx3 * dy1) / denominator;
- return FX_NEW CBC_CommonPerspectiveTransform(
+ return new CBC_CommonPerspectiveTransform(
x1 - x0 + a13 * x1, x3 - x0 + a23 * x3, x0, y1 - y0 + a13 * y1,
y3 - y0 + a23 * y3, y0, a13, a23, 1.0f);
}
@@ -125,7 +125,7 @@ CBC_CommonPerspectiveTransform::QuadrilateralToSquare(FX_FLOAT x0,
return temp1->BuildAdjoint();
}
CBC_CommonPerspectiveTransform* CBC_CommonPerspectiveTransform::BuildAdjoint() {
- return FX_NEW CBC_CommonPerspectiveTransform(
+ return new CBC_CommonPerspectiveTransform(
m_a22 * m_a33 - m_a23 * m_a32, m_a23 * m_a31 - m_a21 * m_a33,
m_a21 * m_a32 - m_a22 * m_a31, m_a13 * m_a32 - m_a12 * m_a33,
m_a11 * m_a33 - m_a13 * m_a31, m_a12 * m_a31 - m_a11 * m_a32,
@@ -134,7 +134,7 @@ CBC_CommonPerspectiveTransform* CBC_CommonPerspectiveTransform::BuildAdjoint() {
}
CBC_CommonPerspectiveTransform* CBC_CommonPerspectiveTransform::Times(
CBC_CommonPerspectiveTransform& other) {
- return FX_NEW CBC_CommonPerspectiveTransform(
+ return new CBC_CommonPerspectiveTransform(
m_a11 * other.m_a11 + m_a21 * other.m_a12 + m_a31 * other.m_a13,
m_a11 * other.m_a21 + m_a21 * other.m_a22 + m_a31 * other.m_a23,
m_a11 * other.m_a31 + m_a21 * other.m_a32 + m_a31 * other.m_a33,
diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
index 88b0c43828..5a15c36f01 100644
--- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
+++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp
@@ -39,7 +39,7 @@ CBC_CommonBitArray* CBC_GlobalHistogramBinarizer::GetBlackRow(
int32_t& e) {
CBC_LuminanceSource* source = GetLuminanceSource();
int32_t width = source->GetWidth();
- CBC_AutoPtr<CBC_CommonBitArray> result(FX_NEW CBC_CommonBitArray(width));
+ CBC_AutoPtr<CBC_CommonBitArray> result(new CBC_CommonBitArray(width));
InitArrays(width);
CFX_ByteArray* localLuminances = source->GetRow(y, m_luminance, e);
if (e != BCExceptionNO) {
@@ -73,7 +73,7 @@ CBC_CommonBitMatrix* CBC_GlobalHistogramBinarizer::GetBlackMatrix(int32_t& e) {
CBC_LuminanceSource* source = GetLuminanceSource();
int32_t width = source->GetWidth();
int32_t height = source->GetHeight();
- CBC_CommonBitMatrix* BitMatrixTemp = FX_NEW CBC_CommonBitMatrix();
+ CBC_CommonBitMatrix* BitMatrixTemp = new CBC_CommonBitMatrix();
BitMatrixTemp->Init(width, height);
CBC_AutoPtr<CBC_CommonBitMatrix> matrix(BitMatrixTemp);
InitArrays(width);
diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
index 251eb5919c..368a12efd7 100644
--- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
+++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp
@@ -196,7 +196,7 @@ CBC_ResultPoint* CBC_WhiteRectangleDetector::GetBlackPointOnSegment(
int32_t x = Round(aX + i * xStep);
int32_t y = Round(aY + i * yStep);
if (m_image->Get(x, y)) {
- return FX_NEW CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT)y);
+ return new CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT)y);
}
}
return NULL;
@@ -222,20 +222,20 @@ CFX_PtrArray* CBC_WhiteRectangleDetector::CenterEdges(CBC_ResultPoint* y,
float ti = t->GetX();
float tj = t->GetY();
if (yi < m_width / 2) {
- CFX_PtrArray* result = FX_NEW CFX_PtrArray;
+ CFX_PtrArray* result = new CFX_PtrArray;
result->SetSize(4);
- (*result)[0] = FX_NEW CBC_ResultPoint(ti - CORR, tj + CORR);
- (*result)[1] = FX_NEW CBC_ResultPoint(zi + CORR, zj + CORR);
- (*result)[2] = FX_NEW CBC_ResultPoint(xi - CORR, xj - CORR);
- (*result)[3] = FX_NEW CBC_ResultPoint(yi + CORR, yj - CORR);
+ (*result)[0] = new CBC_ResultPoint(ti - CORR, tj + CORR);
+ (*result)[1] = new CBC_ResultPoint(zi + CORR, zj + CORR);
+ (*result)[2] = new CBC_ResultPoint(xi - CORR, xj - CORR);
+ (*result)[3] = new CBC_ResultPoint(yi + CORR, yj - CORR);
return result;
} else {
- CFX_PtrArray* result = FX_NEW CFX_PtrArray;
+ CFX_PtrArray* result = new CFX_PtrArray;
result->SetSize(4);
- (*result)[0] = FX_NEW CBC_ResultPoint(ti + CORR, tj + CORR);
- (*result)[1] = FX_NEW CBC_ResultPoint(zi + CORR, zj - CORR);
- (*result)[2] = FX_NEW CBC_ResultPoint(xi - CORR, xj + CORR);
- (*result)[3] = FX_NEW CBC_ResultPoint(yi - CORR, yj - CORR);
+ (*result)[0] = new CBC_ResultPoint(ti + CORR, tj + CORR);
+ (*result)[1] = new CBC_ResultPoint(zi + CORR, zj - CORR);
+ (*result)[2] = new CBC_ResultPoint(xi - CORR, xj + CORR);
+ (*result)[3] = new CBC_ResultPoint(yi - CORR, yj - CORR);
return result;
}
}
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
index 286906d152..c2ddd0f69f 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp
@@ -28,7 +28,7 @@ CBC_ReedSolomonEncoder::CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256* field) {
m_field = field;
}
void CBC_ReedSolomonEncoder::Init() {
- m_cachedGenerators.Add(FX_NEW CBC_ReedSolomonGF256Poly(m_field, 1));
+ m_cachedGenerators.Add(new CBC_ReedSolomonGF256Poly(m_field, 1));
}
CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree,
int32_t& e) {
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
index d57efe1408..b072309a86 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp
@@ -178,7 +178,7 @@ CFX_PtrArray* CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(
CBC_ReedSolomonGF256Poly* rsg14 = r->Multiply(inverse, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> omega(rsg14);
- CFX_PtrArray* temp = FX_NEW CFX_PtrArray;
+ CFX_PtrArray* temp = new CFX_PtrArray;
temp->Add(sigma.release());
temp->Add(omega.release());
return temp;
@@ -188,11 +188,11 @@ CFX_Int32Array* CBC_ReedSolomonDecoder::FindErrorLocations(
int32_t& e) {
int32_t numErrors = errorLocator->GetDegree();
if (numErrors == 1) {
- CBC_AutoPtr<CFX_Int32Array> temp(FX_NEW CFX_Int32Array);
+ CBC_AutoPtr<CFX_Int32Array> temp(new CFX_Int32Array);
temp->Add(errorLocator->GetCoefficients(1));
return temp.release();
}
- CFX_Int32Array* tempT = FX_NEW CFX_Int32Array;
+ CFX_Int32Array* tempT = new CFX_Int32Array;
tempT->SetSize(numErrors);
CBC_AutoPtr<CFX_Int32Array> result(tempT);
int32_t ie = 0;
@@ -215,7 +215,7 @@ CFX_Int32Array* CBC_ReedSolomonDecoder::FindErrorMagnitudes(
FX_BOOL dataMatrix,
int32_t& e) {
int32_t s = errorLocations->GetSize();
- CFX_Int32Array* temp = FX_NEW CFX_Int32Array;
+ CFX_Int32Array* temp = new CFX_Int32Array;
temp->SetSize(s);
CBC_AutoPtr<CFX_Int32Array> result(temp);
for (int32_t i = 0; i < s; i++) {
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
index 43c8c82a4d..d862e9a931 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp
@@ -26,9 +26,9 @@
CBC_ReedSolomonGF256* CBC_ReedSolomonGF256::QRCodeFild = NULL;
CBC_ReedSolomonGF256* CBC_ReedSolomonGF256::DataMatrixField = NULL;
void CBC_ReedSolomonGF256::Initialize() {
- QRCodeFild = FX_NEW CBC_ReedSolomonGF256(0x011D);
+ QRCodeFild = new CBC_ReedSolomonGF256(0x011D);
QRCodeFild->Init();
- DataMatrixField = FX_NEW CBC_ReedSolomonGF256(0x012D);
+ DataMatrixField = new CBC_ReedSolomonGF256(0x012D);
DataMatrixField->Init();
}
void CBC_ReedSolomonGF256::Finalize() {
@@ -56,8 +56,8 @@ CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(int32_t primitive) {
m_logTable[0] = 0;
}
void CBC_ReedSolomonGF256::Init() {
- m_zero = FX_NEW CBC_ReedSolomonGF256Poly(this, 0);
- m_one = FX_NEW CBC_ReedSolomonGF256Poly(this, 1);
+ m_zero = new CBC_ReedSolomonGF256Poly(this, 0);
+ m_one = new CBC_ReedSolomonGF256Poly(this, 1);
}
CBC_ReedSolomonGF256::~CBC_ReedSolomonGF256() {
if (m_zero != NULL) {
@@ -91,7 +91,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(
CFX_Int32Array coefficients;
coefficients.SetSize(degree + 1);
coefficients[0] = coefficient;
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(this, &coefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
index 1ab42eb831..127a20b4f9 100644
--- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
+++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
@@ -93,7 +93,7 @@ int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a) {
return result;
}
CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Clone(int32_t& e) {
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &m_coefficients, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
@@ -130,7 +130,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(
sumDiff[j] = (CBC_ReedSolomonGF256::AddOrSubtract(
smallerCoefficients[j - lengthDiff], largerCoefficients[j]));
}
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &sumDiff, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
@@ -159,7 +159,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(
m_field->Multiply(aCoeff, other->GetCoefficients()->operator[](j)));
}
}
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &product, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
@@ -181,7 +181,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar,
for (int32_t i = 0; i < size; i++) {
product[i] = m_field->Multiply(m_coefficients[i], scalar);
}
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &product, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
@@ -205,7 +205,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(
for (int32_t i = 0; i < size; i++) {
product[i] = (m_field->Multiply(m_coefficients[i], coefficient));
}
- CBC_ReedSolomonGF256Poly* temp = FX_NEW CBC_ReedSolomonGF256Poly();
+ CBC_ReedSolomonGF256Poly* temp = new CBC_ReedSolomonGF256Poly();
temp->Init(m_field, &product, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return temp;
@@ -250,7 +250,7 @@ CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly* other,
CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp1(rsg6);
remainder = temp1;
}
- CFX_PtrArray* tempPtrA = FX_NEW CFX_PtrArray;
+ CFX_PtrArray* tempPtrA = new CFX_PtrArray;
tempPtrA->Add(quotient.release());
tempPtrA->Add(remainder.release());
return tempPtrA;