From e801d4e064690fbe1815d25d220cfbca79976a4f Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 29 Apr 2016 13:45:14 -0700 Subject: 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 --- xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp') diff --git a/xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp b/xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp index 18e5d9ad4c..5ce2e75762 100644 --- a/xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp @@ -24,20 +24,20 @@ #include "xfa/fxbarcode/common/BC_CommonBitMatrix.h" #include "xfa/fxbarcode/qrcode/BC_QRDetectorResult.h" -CBC_QRDetectorResult::CBC_QRDetectorResult(CBC_CommonBitMatrix* bits, - CFX_PtrArray* points) +CBC_QRDetectorResult::CBC_QRDetectorResult( + CBC_CommonBitMatrix* bits, + CFX_ArrayTemplate* points) : m_bits(bits), m_points(points) {} + CBC_QRDetectorResult::~CBC_QRDetectorResult() { - for (int32_t i = 0; i < m_points->GetSize(); i++) { - delete (CBC_ResultPoint*)(*m_points)[i]; - } - m_points->RemoveAll(); - delete m_points; - delete m_bits; + for (int32_t i = 0; i < m_points->GetSize(); i++) + delete (*m_points)[i]; } -CBC_CommonBitMatrix* CBC_QRDetectorResult::GetBits() { - return m_bits; + +CBC_CommonBitMatrix* CBC_QRDetectorResult::GetBits() const { + return m_bits.get(); } -CFX_PtrArray* CBC_QRDetectorResult::GetPoints() { - return m_points; + +CFX_ArrayTemplate* CBC_QRDetectorResult::GetPoints() const { + return m_points.get(); } -- cgit v1.2.3