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

Unified Diff: xfa/fxbarcode/BC_TwoDimWriter.cpp

Issue 2221023003: Use smart pointers for class owned pointers in xfa/fxbarcode (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 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
« no previous file with comments | « xfa/fxbarcode/BC_TwoDimWriter.h ('k') | xfa/fxbarcode/common/BC_CommonByteArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/BC_TwoDimWriter.cpp
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp
index 91ea57097a5903ca9aec89962d3cec675246014b..e4cc6e890a785a103d591b85a1025c6cae81fb49 100644
--- a/xfa/fxbarcode/BC_TwoDimWriter.cpp
+++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp
@@ -13,14 +13,10 @@
#include "xfa/fxbarcode/BC_Writer.h"
#include "xfa/fxbarcode/common/BC_CommonBitMatrix.h"
-CBC_TwoDimWriter::CBC_TwoDimWriter() {
- m_iCorrectLevel = 1;
- m_bFixedSize = TRUE;
- m_output = nullptr;
-}
-CBC_TwoDimWriter::~CBC_TwoDimWriter() {
- delete m_output;
-}
+CBC_TwoDimWriter::CBC_TwoDimWriter() : m_iCorrectLevel(1), m_bFixedSize(TRUE) {}
+
+CBC_TwoDimWriter::~CBC_TwoDimWriter() {}
+
void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix) {
CFX_GraphStateData stateData;
@@ -55,7 +51,7 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
}
}
-int32_t CBC_TwoDimWriter::GetErrorCorrectionLevel() {
+int32_t CBC_TwoDimWriter::GetErrorCorrectionLevel() const {
return m_iCorrectLevel;
}
@@ -136,7 +132,7 @@ void CBC_TwoDimWriter::RenderResult(uint8_t* code,
if (topPadding < 0) {
topPadding = 0;
}
- m_output = new CBC_CommonBitMatrix;
+ m_output.reset(new CBC_CommonBitMatrix);
m_output->Init(outputWidth, outputHeight);
for (int32_t inputY = 0, outputY = topPadding;
(inputY < inputHeight) && (outputY < outputHeight - multiY);
« no previous file with comments | « xfa/fxbarcode/BC_TwoDimWriter.h ('k') | xfa/fxbarcode/common/BC_CommonByteArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698