summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-29 13:45:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-29 13:45:14 -0700
commite801d4e064690fbe1815d25d220cfbca79976a4f (patch)
treec7955761755597d8430b70f2e477d7b7a272f46b /xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
parente7ca8ba0f76d175eb89e4cc3aa3aa2743711414e (diff)
downloadpdfium-e801d4e064690fbe1815d25d220cfbca79976a4f.tar.xz
Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 9
Converted one place to unique_ptr to avoid redundant cleanup. Review-Url: https://codereview.chromium.org/1937593002
Diffstat (limited to 'xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp')
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
index 3a6d73fd40..8783e87f1b 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp
@@ -50,7 +50,7 @@ void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() {
int32_t
CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(
CBC_BarcodeMetadata barcodeMetadata) {
- CFX_PtrArray* codewords = getCodewords();
+ CFX_ArrayTemplate<CBC_Codeword*>* codewords = getCodewords();
setRowNumbers();
removeIncorrectCodewords(codewords, barcodeMetadata);
CBC_BoundingBox* boundingBox = getBoundingBox();
@@ -70,7 +70,7 @@ CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
- CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
+ CBC_Codeword* codeword = codewords->GetAt(codewordsRow);
int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
currentRowHeight++;
@@ -138,7 +138,7 @@ int32_t CBC_DetectionResultRowIndicatorColumn::
int32_t lastRow = imageRowToCodewordIndex((int32_t)bottom->GetY());
FX_FLOAT averageRowHeight =
(lastRow - firstRow) / (FX_FLOAT)barcodeMetadata.getRowCount();
- CFX_PtrArray* codewords = getCodewords();
+ CFX_ArrayTemplate<CBC_Codeword*>* codewords = getCodewords();
int32_t barcodeRow = -1;
int32_t maxRowHeight = 1;
int32_t currentRowHeight = 0;
@@ -147,7 +147,7 @@ int32_t CBC_DetectionResultRowIndicatorColumn::
if (codewords->GetAt(codewordsRow) == NULL) {
continue;
}
- CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow);
+ CBC_Codeword* codeword = codewords->GetAt(codewordsRow);
codeword->setRowNumberAsRowIndicatorColumn();
int32_t rowDifference = codeword->getRowNumber() - barcodeRow;
if (rowDifference == 0) {
@@ -168,13 +168,13 @@ int32_t CBC_DetectionResultRowIndicatorColumn::
}
CBC_BarcodeMetadata*
CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() {
- CFX_PtrArray* codewords = getCodewords();
+ CFX_ArrayTemplate<CBC_Codeword*>* codewords = getCodewords();
CBC_BarcodeValue barcodeColumnCount;
CBC_BarcodeValue barcodeRowCountUpperPart;
CBC_BarcodeValue barcodeRowCountLowerPart;
CBC_BarcodeValue barcodeECLevel;
for (int32_t i = 0; i < codewords->GetSize(); i++) {
- CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i);
+ CBC_Codeword* codeword = codewords->GetAt(i);
if (codeword == NULL) {
continue;
}
@@ -226,11 +226,11 @@ CFX_ByteString CBC_DetectionResultRowIndicatorColumn::toString() {
CBC_DetectionResultColumn::toString();
}
void CBC_DetectionResultRowIndicatorColumn::removeIncorrectCodewords(
- CFX_PtrArray* codewords,
+ CFX_ArrayTemplate<CBC_Codeword*>* codewords,
CBC_BarcodeMetadata barcodeMetadata) {
for (int32_t codewordRow = 0; codewordRow < codewords->GetSize();
codewordRow++) {
- CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordRow);
+ CBC_Codeword* codeword = codewords->GetAt(codewordRow);
if (codeword == NULL) {
continue;
}