diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-16 03:17:29 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-16 04:07:21 +0200 |
commit | c7fe625c8d41f648f89765abc40bb7b8fd4ed12a (patch) | |
tree | 38cf7233fe9a647fab44e33dc6cd78096708f587 /hwpfilter | |
parent | f054b9187155bc32b7d06808aea87127cb0a3a4f (diff) |
don't use memset on structure with std::shared_ptr member
Change-Id: Ie6033b9820435bb6a45aa70f9a48115000571e0f
Reviewed-on: https://gerrit.libreoffice.org/40004
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hinfo.cxx | 25 | ||||
-rw-r--r-- | hwpfilter/source/hinfo.h | 2 | ||||
-rw-r--r-- | hwpfilter/source/hpara.cxx | 1 | ||||
-rw-r--r-- | hwpfilter/source/hstyle.cxx | 2 |
4 files changed, 28 insertions, 2 deletions
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx index 3d262b5c7d1e..3ad38721404e 100644 --- a/hwpfilter/source/hinfo.cxx +++ b/hwpfilter/source/hinfo.cxx @@ -192,6 +192,31 @@ bool HWPSummary::Read(HWPFile & hwpf) return (!hwpf.State()); } +ParaShape::ParaShape(): + index(0), + left_margin(0), + right_margin(0), + indent(0), + lspacing(0), + pspacing_prev(0), + pspacing_next(0), + condense(0), + arrange_type(0), + shade(0), + outline(0), + outline_continue(0), + pagebreak(0) +{ + coldef.ncols = 0; + coldef.separator = 0; + coldef.spacing = 0; + coldef.columnlen = 0; + coldef.columnlen0 = 0; + reserved[0] = 0; + reserved[1] = 0; + reserved[0] = 0; + reserved[1] = 0; +} void ParaShape::Read(HWPFile & hwpf) { diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h index e9c17f8081bd..864e2ac031ec 100644 --- a/hwpfilter/source/hinfo.h +++ b/hwpfilter/source/hinfo.h @@ -287,6 +287,8 @@ struct ParaShape unsigned char pagebreak; void Read(HWPFile &); + + ParaShape(); }; #endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx index 0534862c641a..5d9dd47c3d24 100644 --- a/hwpfilter/source/hpara.cxx +++ b/hwpfilter/source/hpara.cxx @@ -79,7 +79,6 @@ HWPPara::HWPPara() , pshape(new ParaShape) { memset(cshape.get(), 0, sizeof(CharShape)); - memset(pshape.get(), 0, sizeof(ParaShape)); } HWPPara::~HWPPara() diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx index 6c29a500d2b5..d43b3c8fc785 100644 --- a/hwpfilter/source/hstyle.cxx +++ b/hwpfilter/source/hstyle.cxx @@ -108,7 +108,7 @@ void HWPStyle::SetParaShape(int n, ParaShape * pshapep) if (pshapep) DATA[n].pshape = *pshapep; else - memset(&DATA[n].pshape, 0, sizeof(ParaShape)); + DATA[n].pshape = ParaShape(); } } |