diff options
author | tsepez <tsepez@chromium.org> | 2016-06-06 12:57:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-06 12:57:44 -0700 |
commit | 52d78564a61fad5d435f3c95a3a6c0df142e50cf (patch) | |
tree | 209840b7f578c0e35722984b789a2e9e84d5d428 /xfa/fxbarcode/cbc_codebase.h | |
parent | fe433f15d60f92ccde7a928160c2e7cc77dcb8bf (diff) | |
download | pdfium-52d78564a61fad5d435f3c95a3a6c0df142e50cf.tar.xz |
Clean up C-Style casts in CBC_CodeBase and subclasses
Make the parent class own the reader/writer via unique_ptrs.
De-virtualize some methods with no overrides.
Review-Url: https://codereview.chromium.org/2037573005
Diffstat (limited to 'xfa/fxbarcode/cbc_codebase.h')
-rw-r--r-- | xfa/fxbarcode/cbc_codebase.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fxbarcode/cbc_codebase.h b/xfa/fxbarcode/cbc_codebase.h index 2124f75d78..1ecfe20b27 100644 --- a/xfa/fxbarcode/cbc_codebase.h +++ b/xfa/fxbarcode/cbc_codebase.h @@ -7,6 +7,8 @@ #ifndef XFA_FXBARCODE_CBC_CODEBASE_H_ #define XFA_FXBARCODE_CBC_CODEBASE_H_ +#include <memory> + #include "core/fxcrt/include/fx_system.h" #include "core/fxge/include/fx_dib.h" #include "xfa/fxbarcode/include/BC_Library.h" @@ -18,7 +20,7 @@ class CFX_RenderDevice; class CBC_CodeBase { public: - CBC_CodeBase(); + CBC_CodeBase(CBC_Reader* pReader, CBC_Writer* pWriter); virtual ~CBC_CodeBase(); virtual BC_TYPE GetType() = 0; @@ -35,18 +37,17 @@ class CBC_CodeBase { int32_t& e) = 0; virtual CFX_WideString Decode(CFX_DIBitmap* pBitmap, int32_t& e) = 0; - virtual FX_BOOL SetCharEncoding(int32_t encoding); - virtual FX_BOOL SetModuleHeight(int32_t moduleHeight); - virtual FX_BOOL SetModuleWidth(int32_t moduleWidth); - - virtual FX_BOOL SetHeight(int32_t height); - virtual FX_BOOL SetWidth(int32_t width); - virtual void SetBackgroundColor(FX_ARGB backgroundColor); - virtual void SetBarcodeColor(FX_ARGB foregroundColor); + FX_BOOL SetCharEncoding(int32_t encoding); + FX_BOOL SetModuleHeight(int32_t moduleHeight); + FX_BOOL SetModuleWidth(int32_t moduleWidth); + FX_BOOL SetHeight(int32_t height); + FX_BOOL SetWidth(int32_t width); + void SetBackgroundColor(FX_ARGB backgroundColor); + void SetBarcodeColor(FX_ARGB foregroundColor); protected: - CBC_Writer* m_pBCWriter; - CBC_Reader* m_pBCReader; + std::unique_ptr<CBC_Reader> m_pBCReader; + std::unique_ptr<CBC_Writer> m_pBCWriter; }; #endif // XFA_FXBARCODE_CBC_CODEBASE_H_ |