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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRCodeReader.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/qrcode/BC_QRCodeReader.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp
index c594230428b8eb5d484536f99e3cbea8150e786d..896a3a107b062b2e837857f32d8334cde2f5ff6f 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,

Powered by Google App Engine
This is Rietveld 408576698