summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-06 12:25:58 +0100
committerAndras Timar <andras.timar@collabora.com>2017-07-12 10:53:25 +0200
commit5e202bddea9042a0a546c33621a0ca28f7125fab (patch)
treeca813068a6319035b2fc1d1520f53e887abc4b19 /hwpfilter
parent0560a658e65089348da43340c543612aa9cae404 (diff)
ofz#2452 use shared_ptr for cshape
Change-Id: Icf576c08b3502ea3e24fa4b3685b55f794e844db Reviewed-on: https://gerrit.libreoffice.org/39652 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit cc7fafdb7ae954861a9bc83bb8a5207e9c9eccdf)
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hinfo.h6
-rw-r--r--hwpfilter/source/hpara.cxx2
-rw-r--r--hwpfilter/source/hwpreader.cxx2
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 <memory>
#include <vector>
#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<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 a9a6fa2c147f..28d579507d95 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -111,7 +111,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 4fc026a34b04..54ec8f550842 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -1477,7 +1477,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();