From 8f0d0da1b12e29133fb48a778603c03bf0056124 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 2 May 2016 09:34:35 -0700 Subject: Replace CFX_PtrArray with typesafe CFX_ArrayTemplate, part 10 Review-Url: https://codereview.chromium.org/1936733002 --- xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp | 28 +++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp') diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp b/xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp index 557d50d951..4b68bdf678 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp @@ -24,27 +24,25 @@ #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" #include "xfa/fxbarcode/pdf417/BC_PDF417DetectorResult.h" -CBC_PDF417DetectorResult::CBC_PDF417DetectorResult(CBC_CommonBitMatrix* bits, - CFX_PtrArray* points) { - m_bits = bits; - m_points = points; -} +CBC_PDF417DetectorResult::CBC_PDF417DetectorResult( + CBC_CommonBitMatrix* bits, + CBC_ResultPointArrayArray* points) + : m_bits(bits), m_points(points) {} + CBC_PDF417DetectorResult::~CBC_PDF417DetectorResult() { for (int32_t i = 0; i < m_points->GetSize(); i++) { - CFX_PtrArray* temp = (CFX_PtrArray*)m_points->GetAt(i); - for (int32_t j = 0; j < temp->GetSize(); j++) { - delete (CBC_ResultPoint*)temp->GetAt(j); - } - temp->RemoveAll(); + CBC_ResultPointArray* temp = m_points->GetAt(i); + for (int32_t j = 0; j < temp->GetSize(); j++) + delete temp->GetAt(j); + delete temp; } - m_points->RemoveAll(); - delete m_points; } -CBC_CommonBitMatrix* CBC_PDF417DetectorResult::getBits() { + +CBC_CommonBitMatrix* CBC_PDF417DetectorResult::getBits() const { return m_bits; } -CFX_PtrArray* CBC_PDF417DetectorResult::getPoints() { - return m_points; +CBC_ResultPointArrayArray* CBC_PDF417DetectorResult::getPoints() const { + return m_points.get(); } -- cgit v1.2.3