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

Unified Diff: xfa/fxbarcode/oned/BC_OnedUPCAWriter.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/oned/BC_OnedUPCAWriter.h ('k') | xfa/fxbarcode/pdf417/BC_PDF417.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index 158af2cdd7eaa98eae0fe4a370491ebfef32d6f5..f8065a6f95a55c11ba30007c0df9962b2797902c 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -27,17 +27,16 @@
#include "xfa/fxbarcode/oned/BC_OnedUPCAWriter.h"
CBC_OnedUPCAWriter::CBC_OnedUPCAWriter() {
- m_subWriter = nullptr;
m_bLeftPadding = TRUE;
m_bRightPadding = TRUE;
}
+
void CBC_OnedUPCAWriter::Init() {
- m_subWriter = new CBC_OnedEAN13Writer;
-}
-CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() {
- delete m_subWriter;
+ m_subWriter.reset(new CBC_OnedEAN13Writer);
}
+CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() {}
+
FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(
const CFX_WideStringC& contents) {
for (FX_STRSIZE i = 0; i < contents.GetLength(); ++i) {
@@ -63,6 +62,7 @@ CFX_WideString CBC_OnedUPCAWriter::FilterContents(
}
return filtercontents;
}
+
int32_t CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString& contents) {
int32_t odd = 0;
int32_t even = 0;
@@ -79,6 +79,7 @@ int32_t CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString& contents) {
checksum = (10 - checksum) % 10;
return (checksum);
}
+
uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
BCFORMAT format,
int32_t& outWidth,
@@ -88,6 +89,7 @@ uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
return ret;
}
+
uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
BCFORMAT format,
int32_t& outWidth,
« no previous file with comments | « xfa/fxbarcode/oned/BC_OnedUPCAWriter.h ('k') | xfa/fxbarcode/pdf417/BC_PDF417.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698