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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.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_QRBitMatrixParser.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
index d44995385abbd68062a49c7d0dbdcc02b9ce2a82..7426d95d4cc81bb750a2157f3d5585b7a6a63143 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
@@ -20,8 +20,11 @@
* limitations under the License.
*/
-#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h"
+
+#include <memory>
+
+#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRDataMask.h"
@@ -140,13 +143,12 @@ CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(int32_t& e) {
int32_t dimension = m_bitMatrix->GetDimension(e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
dataMask->UnmaskBitMatirx(m_bitMatrix, dimension);
- CBC_CommonBitMatrix* cbm = version->BuildFunctionPattern(e);
+ std::unique_ptr<CBC_CommonBitMatrix> functionPattern(
+ version->BuildFunctionPattern(e));
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- CBC_AutoPtr<CBC_CommonBitMatrix> functionPattern(cbm);
FX_BOOL readingUp = TRUE;
- CFX_ByteArray* temp = new CFX_ByteArray;
- temp->SetSize(version->GetTotalCodeWords());
- CBC_AutoPtr<CFX_ByteArray> result(temp);
+ std::unique_ptr<CFX_ByteArray> result(new CFX_ByteArray);
+ result->SetSize(version->GetTotalCodeWords());
int32_t resultOffset = 0;
int32_t currentByte = 0;
int32_t bitsRead = 0;

Powered by Google App Engine
This is Rietveld 408576698