summaryrefslogtreecommitdiff
path: root/hwpfilter/source/hwpfile.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-08 21:04:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-13 09:53:04 +0200
commit3b9b4ca5d3aa15d51d6b54a5f5f23967f1666889 (patch)
treea96a8ed89ba8c20d0e196c251d10c9b3813a634e /hwpfilter/source/hwpfile.cxx
parent25d2b02f452d7c27d02a93f5ad26d0b3834c0d84 (diff)
ofz#1062 ensure cshape lifecycle matches expectations
Change-Id: I586e9b3546516a0f05d86b2f7dd93e7c292a6795 Reviewed-on: https://gerrit.libreoffice.org/36298 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter/source/hwpfile.cxx')
-rw-r--r--hwpfilter/source/hwpfile.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 3ab2b0087a6c..f883a2243f40 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -245,8 +245,8 @@ void HWPFile::ParaListRead()
bool HWPFile::ReadParaList(std::list < HWPPara* > &aplist, unsigned char flag)
{
std::unique_ptr<HWPPara> spNode( new HWPPara );
- unsigned char tmp_etcflag;
- unsigned char prev_etcflag = 0;
+ unsigned char tmp_etcflag;
+ unsigned char prev_etcflag = 0;
while (spNode->Read(*this, flag))
{
if( !(spNode->etcflag & 0x04) ){
@@ -492,7 +492,7 @@ CharShape *HWPFile::getCharShape(int index)
{
if (index < 0 || static_cast<unsigned int>(index) >= cslist.size())
return nullptr;
- return cslist[index];
+ return cslist[index].get();
}
FBoxStyle *HWPFile::getFBoxStyle(int index)
@@ -562,11 +562,10 @@ void HWPFile::AddParaShape(ParaShape * pshape)
pshape->index = value;
}
-
-void HWPFile::AddCharShape(CharShape * cshape)
+void HWPFile::AddCharShape(std::shared_ptr<CharShape>& cshape)
{
- int value = compareCharShape(cshape);
- if( value == 0 )
+ int value = compareCharShape(cshape.get());
+ if (value == 0)
{
cshape->index = ++ccount;
cslist.push_back(cshape);