summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
commit2e6864282e65c55ff6809f5aaae011b31c3a361a (patch)
tree98daecaf078529986a4efc2c43a3f43c0dcc01dd /xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
parent969ea09df096b987662b9658e3ffa023ca4ebf70 (diff)
downloadpdfium-2e6864282e65c55ff6809f5aaae011b31c3a361a.tar.xz
Get rid of CBC_AutoPtr and use std::unique_ptr instead.
Also fix IWYU in various fxbarcode headers. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1734823002 .
Diffstat (limited to 'xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
index 1fd8742690..72ce42fc4c 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp
@@ -20,14 +20,16 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRDetector.h"
+
#include <algorithm>
+#include <memory>
#include "xfa/src/fxbarcode/BC_ResultPoint.h"
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/qrcode/BC_FinderPatternInfo.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRDetector.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h"
@@ -37,9 +39,8 @@ CBC_QRDetector::CBC_QRDetector(CBC_CommonBitMatrix* image) : m_image(image) {}
CBC_QRDetector::~CBC_QRDetector() {}
CBC_QRDetectorResult* CBC_QRDetector::Detect(int32_t hints, int32_t& e) {
CBC_QRFinderPatternFinder finder(m_image);
- CBC_QRFinderPatternInfo* qpi = finder.Find(hints, e);
+ std::unique_ptr<CBC_QRFinderPatternInfo> info(finder.Find(hints, e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- CBC_AutoPtr<CBC_QRFinderPatternInfo> info(qpi);
CBC_QRDetectorResult* qdr = ProcessFinderPatternInfo(info.get(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
return qdr;
@@ -47,9 +48,9 @@ CBC_QRDetectorResult* CBC_QRDetector::Detect(int32_t hints, int32_t& e) {
CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(
CBC_QRFinderPatternInfo* info,
int32_t& e) {
- CBC_AutoPtr<CBC_QRFinderPattern> topLeft(info->GetTopLeft());
- CBC_AutoPtr<CBC_QRFinderPattern> topRight(info->GetTopRight());
- CBC_AutoPtr<CBC_QRFinderPattern> bottomLeft(info->GetBottomLeft());
+ std::unique_ptr<CBC_QRFinderPattern> topLeft(info->GetTopLeft());
+ std::unique_ptr<CBC_QRFinderPattern> topRight(info->GetTopRight());
+ std::unique_ptr<CBC_QRFinderPattern> bottomLeft(info->GetBottomLeft());
FX_FLOAT moduleSize =
CalculateModuleSize(topLeft.get(), topRight.get(), bottomLeft.get());
if (moduleSize < 1.0f) {