From 893f77094139bfc2befaf4947126aae97fee137f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 6 Jul 2017 12:25:58 +0100 Subject: ofz#2452 use shared_ptr for cshape Change-Id: Icf576c08b3502ea3e24fa4b3685b55f794e844db Reviewed-on: https://gerrit.libreoffice.org/39649 Reviewed-by: Michael Stahl Tested-by: Jenkins --- hwpfilter/source/hinfo.h | 6 +++--- hwpfilter/source/hpara.cxx | 2 +- hwpfilter/source/hwpreader.cxx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h index 7f1eee0657c7..7adc9e94ac30 100644 --- a/hwpfilter/source/hinfo.h +++ b/hwpfilter/source/hinfo.h @@ -23,6 +23,7 @@ #include "hwplib.h" #include "string.h" +#include #include #define CHAIN_MAX_PATH 40 @@ -282,11 +283,10 @@ struct ParaShape unsigned char outline; unsigned char outline_continue; unsigned char reserved[2]; - CharShape *cshape; - unsigned char pagebreak; + std::shared_ptr cshape; + unsigned char pagebreak; void Read(HWPFile &); -// virtual ~ParaShape(); }; #endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx index f4e41c256347..f93e6b5c120f 100644 --- a/hwpfilter/source/hpara.cxx +++ b/hwpfilter/source/hpara.cxx @@ -109,7 +109,7 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag) if (nch && !reuse_shape) { pshape->Read(hwpf); - pshape->cshape = cshape.get(); + pshape->cshape = cshape; pshape->pagebreak = etcflag; } diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index a07afb5a058a..db4d1d3c1a90 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -1482,7 +1482,7 @@ void HwpReader::makePStyle(ParaShape * pshape) rstartEl("style:style", mxList.get()); mxList->clear(); parseParaShape(pshape); - parseCharShape(pshape->cshape); + parseCharShape(pshape->cshape.get()); rstartEl("style:properties", mxList.get()); mxList->clear(); -- cgit v1.2.3