From 6719c2f8c2e7bb3e28c86f638fb7914af6789285 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 14 Sep 2018 17:59:44 +0000 Subject: Initialize CBC_OneDimWriter members in the header. Rearrange them as well. Change-Id: I8653004cd06a4054e32d0148adc1400029ceb34e Reviewed-on: https://pdfium-review.googlesource.com/42459 Reviewed-by: Ryan Harrison Commit-Queue: Lei Zhang --- fxbarcode/oned/BC_OneDimWriter.cpp | 16 ++-------------- fxbarcode/oned/BC_OneDimWriter.h | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp index 03be25fc35..c76817d138 100644 --- a/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/fxbarcode/oned/BC_OneDimWriter.cpp @@ -35,21 +35,9 @@ #include "fxbarcode/BC_Writer.h" #include "third_party/base/ptr_util.h" -CBC_OneDimWriter::CBC_OneDimWriter() { - m_locTextLoc = BC_TEXT_LOC_BELOWEMBED; - m_bPrintChecksum = true; - m_iDataLenth = 0; - m_bCalcChecksum = false; - m_pFont = nullptr; - m_fFontSize = 10; - m_iFontStyle = 0; - m_fontColor = 0xff000000; - m_iContentLen = 0; - m_bLeftPadding = false; - m_bRightPadding = false; -} +CBC_OneDimWriter::CBC_OneDimWriter() = default; -CBC_OneDimWriter::~CBC_OneDimWriter() {} +CBC_OneDimWriter::~CBC_OneDimWriter() = default; void CBC_OneDimWriter::SetPrintChecksum(bool checksum) { m_bPrintChecksum = checksum; diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h index a597d860f6..e25ee58140 100644 --- a/fxbarcode/oned/BC_OneDimWriter.h +++ b/fxbarcode/oned/BC_OneDimWriter.h @@ -83,17 +83,20 @@ class CBC_OneDimWriter : public CBC_Writer { wchar_t Upper(wchar_t ch); void RenderVerticalBars(int32_t outputX, int32_t width, int32_t height); - bool m_bPrintChecksum; - int32_t m_iDataLenth; - bool m_bCalcChecksum; + bool m_bPrintChecksum = true; + bool m_bCalcChecksum = false; + bool m_bLeftPadding = false; + bool m_bRightPadding = false; + UnownedPtr m_pFont; - float m_fFontSize; - int32_t m_iFontStyle; - uint32_t m_fontColor; - BC_TEXT_LOC m_locTextLoc; - size_t m_iContentLen; - bool m_bLeftPadding; - bool m_bRightPadding; + float m_fFontSize = 10.0f; + int32_t m_iFontStyle = 0; + uint32_t m_fontColor = 0xff000000; + BC_TEXT_LOC m_locTextLoc = BC_TEXT_LOC_BELOWEMBED; + + int32_t m_iDataLenth = 0; + size_t m_iContentLen = 0; + std::vector m_output; int32_t m_barWidth; int32_t m_multiple; -- cgit v1.2.3