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/qrcode/BC_QRBitMatrixParser.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/qrcode/BC_QRBitMatrixParser.cpp')
-rw-r--r-- | xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp index d44995385a..7426d95d4c 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; |