summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-06 12:25:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-13 17:38:59 +0200
commit8e63f09967ec91d29d385097e737efc6d02fa3a0 (patch)
treefa3f0a01c21eee15b0523da20be6b51e805cab2d /hwpfilter
parent898522c8563a3e59b8de295ceb766cb8e2024ed5 (diff)
ofz#2452 use shared_ptr for cshape
Change-Id: Icf576c08b3502ea3e24fa4b3685b55f794e844db Reviewed-on: https://gerrit.libreoffice.org/39650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hinfo.h5
-rw-r--r--hwpfilter/source/hpara.cxx2
-rw-r--r--hwpfilter/source/hwpreader.cxx2
3 files changed, 4 insertions, 5 deletions
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index a381cc1dfb59..e9c17f8081bd 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -283,11 +283,10 @@ struct ParaShape
unsigned char outline;
unsigned char outline_continue;
unsigned char reserved[2];
- CharShape *cshape;
- unsigned char pagebreak;
+ std::shared_ptr<CharShape> 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 e31a8b8005ae..0534862c641a 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -108,7 +108,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 3c6e1543cec8..3f32c3b47c9b 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();