diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-24 18:20:51 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-24 18:20:51 -0800 |
commit | 2e6864282e65c55ff6809f5aaae011b31c3a361a (patch) | |
tree | 98daecaf078529986a4efc2c43a3f43c0dcc01dd /xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp | |
parent | 969ea09df096b987662b9658e3ffa023ca4ebf70 (diff) | |
download | pdfium-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/datamatrix/BC_DataMatrixReader.cpp')
-rw-r--r-- | xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index 2586751107..36a238b007 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -20,12 +20,15 @@ * limitations under the License. */ +#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h" + +#include <memory> + #include "xfa/src/fxbarcode/BC_BinaryBitmap.h" #include "xfa/src/fxbarcode/BC_Reader.h" #include "xfa/src/fxbarcode/common/BC_CommonDecoderResult.h" #include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h" #include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h" -#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h" #include "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.h" #include "xfa/src/fxbarcode/utils.h" @@ -47,13 +50,11 @@ CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap* image, CBC_DataMatrixDetector detector(cdr); detector.Init(e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - CBC_QRDetectorResult* ddr = detector.Detect(e); + std::unique_ptr<CBC_QRDetectorResult> detectorResult(detector.Detect(e)); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - CBC_AutoPtr<CBC_QRDetectorResult> detectorResult(ddr); - CBC_CommonDecoderResult* ResultTemp = - m_decoder->Decode(detectorResult->GetBits(), e); + std::unique_ptr<CBC_CommonDecoderResult> decodeResult( + m_decoder->Decode(detectorResult->GetBits(), e)); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - CBC_AutoPtr<CBC_CommonDecoderResult> decodeResult(ResultTemp); return decodeResult->GetText(); } CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap* image, |