summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
commit2e6864282e65c55ff6809f5aaae011b31c3a361a (patch)
tree98daecaf078529986a4efc2c43a3f43c0dcc01dd /xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp
parent969ea09df096b987662b9658e3ffa023ca4ebf70 (diff)
downloadpdfium-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_QRDataBlock.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp
index 75ad077521..185e16c5b7 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp
@@ -20,10 +20,13 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h"
#include "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h"
#include "xfa/src/fxbarcode/utils.h"
CBC_QRDataBlock::CBC_QRDataBlock(int32_t numDataCodewords,
@@ -54,9 +57,8 @@ CFX_PtrArray* CBC_QRDataBlock::GetDataBlocks(
for (i = 0; i < ecBlockArray->GetSize(); i++) {
totalBlocks += ((CBC_QRCoderECB*)(*ecBlockArray)[i])->GetCount();
}
- CFX_PtrArray* datablock = new CFX_PtrArray();
- datablock->SetSize(totalBlocks);
- CBC_AutoPtr<CFX_PtrArray> result(datablock);
+ std::unique_ptr<CFX_PtrArray> result(new CFX_PtrArray());
+ result->SetSize(totalBlocks);
int32_t numResultBlocks = 0;
for (int32_t j = 0; j < ecBlockArray->GetSize(); j++) {
CBC_QRCoderECB* ecBlock = (CBC_QRCoderECB*)(*ecBlockArray)[j];