summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.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_QRCodeReader.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_QRCodeReader.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp
index c594230428..896a3a107b 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp
@@ -20,6 +20,10 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/BC_Binarizer.h"
#include "xfa/src/fxbarcode/BC_BinaryBitmap.h"
#include "xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h"
@@ -29,9 +33,6 @@
#include "xfa/src/fxbarcode/common/BC_CommonDecoderResult.h"
#include "xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h"
@@ -54,13 +55,12 @@ CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap* image,
CBC_CommonBitMatrix* matrix = image->GetMatrix(e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
CBC_QRDetector detector(matrix);
- CBC_QRDetectorResult* qdr = detector.Detect(hints, e);
+ std::unique_ptr<CBC_QRDetectorResult> detectorResult(
+ detector.Detect(hints, e));
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- CBC_AutoPtr<CBC_QRDetectorResult> detectorResult(qdr);
- CBC_CommonDecoderResult* qdr2 =
- m_decoder->Decode(detectorResult->GetBits(), 0, e);
+ std::unique_ptr<CBC_CommonDecoderResult> decodeResult(
+ m_decoder->Decode(detectorResult->GetBits(), 0, e));
BC_EXCEPTION_CHECK_ReturnValue(e, "");
- CBC_AutoPtr<CBC_CommonDecoderResult> decodeResult(qdr2);
return (decodeResult->GetText());
}
CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString& filename,