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

Unified Diff: xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.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_DataMatrixDecoder.cpp
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
index 49a1d1654ace576cf4a9e4cbad04f8d65895bc74..423cefc65fcf14b578c2dd48ece19968abd68c7e 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp
@@ -20,13 +20,16 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h"
#include "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h"
#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h"
#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h"
#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h"
-#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h"
#include "xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h"
CBC_DataMatrixDecoder::CBC_DataMatrixDecoder() {
@@ -46,9 +49,8 @@ CBC_CommonDecoderResult* CBC_DataMatrixDecoder::Decode(
parser.Init(bits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
CBC_DataMatrixVersion* version = parser.GetVersion();
- CFX_ByteArray* byteTemp = parser.ReadCodewords(e);
+ std::unique_ptr<CFX_ByteArray> codewords(parser.ReadCodewords(e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- CBC_AutoPtr<CFX_ByteArray> codewords(byteTemp);
CFX_PtrArray* dataBlocks =
CBC_DataMatrixDataBlock::GetDataBlocks(codewords.get(), version, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);

Powered by Google App Engine
This is Rietveld 408576698