summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-09 13:45:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-09 13:45:03 -0700
commite76203dbefd1df075a063ee019c3908513f6bee5 (patch)
tree2a763852e1d1de3eee6a67285ea96be2874bfb00 /xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
parentad5ac7584844b03c5ceed082e5f5158a632405cc (diff)
downloadpdfium-e76203dbefd1df075a063ee019c3908513f6bee5.tar.xz
Use smart pointers for class owned pointers in xfa/fxbarcode
For classes under xfa/fxbarcode, use smart pointers instead of raw pointer to make memory management easier. Also fix some styling issues along the changes. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2221023003
Diffstat (limited to 'xfa/fxbarcode/oned/BC_OnedUPCAWriter.h')
-rw-r--r--xfa/fxbarcode/oned/BC_OnedUPCAWriter.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
index 8257dfa4b6..b38a235076 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
@@ -7,6 +7,8 @@
#ifndef XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_
#define XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_
+#include <memory>
+
#include "core/fxcrt/include/fx_string.h"
#include "core/fxcrt/include/fx_system.h"
#include "xfa/fxbarcode/oned/BC_OneDimWriter.h"
@@ -21,8 +23,6 @@ class CBC_OnedUPCAWriter : public CBC_OneDimWriter {
CBC_OnedUPCAWriter();
~CBC_OnedUPCAWriter() override;
- virtual void Init();
-
// CBC_OneDimWriter
uint8_t* Encode(const CFX_ByteString& contents,
BCFORMAT format,
@@ -46,6 +46,8 @@ class CBC_OnedUPCAWriter : public CBC_OneDimWriter {
int32_t& e) override;
FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
+
+ void Init();
int32_t CalcChecksum(const CFX_ByteString& contents);
protected:
@@ -58,7 +60,7 @@ class CBC_OnedUPCAWriter : public CBC_OneDimWriter {
int32_t& e) override;
private:
- CBC_OnedEAN13Writer* m_subWriter;
+ std::unique_ptr<CBC_OnedEAN13Writer> m_subWriter;
};
#endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_