Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp

Issue 1734823002: Get rid of CBC_AutoPtr and use std::unique_ptr instead. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp
index 2586751107825d1501bc2aa490640a71550269e6..36a238b007ffc40061ba08faa04c2569fc09494e 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,

Powered by Google App Engine
This is Rietveld 408576698