summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/qrcode/BC_QRDetectorResult.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/qrcode/BC_QRDetectorResult.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/qrcode/BC_QRDetectorResult.cpp')
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRDetectorResult.cpp24
1 files changed, 12 insertions, 12 deletions
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<CBC_ResultPoint*>* 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_ResultPoint*>* CBC_QRDetectorResult::GetPoints() const {
+ return m_points.get();
}