diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-18 15:53:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-19 11:21:10 +0200 |
commit | b462fa972e27d9c1510ee547e95f3e9062e4579d (patch) | |
tree | bdfd0d1fe8eabda3f39031ffb398c5a71defdfba /hwpfilter/source/hwpfile.cxx | |
parent | 3991cd38484883b8544be908b6834564345fd0f1 (diff) |
use std::unique_ptr in hwpfilter
Change-Id: I3aa6e1342f975420b19e9e21058a0331ed2d71e0
Reviewed-on: https://gerrit.libreoffice.org/43525
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter/source/hwpfile.cxx')
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 2bb3350fc4a5..a93e03f3023a 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -267,6 +267,41 @@ bool HWPFile::ReadParaList(std::vector < HWPPara* > &aplist, unsigned char flag) return true; } +bool HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsigned char flag) +{ + std::unique_ptr<HWPPara> spNode( new HWPPara ); + unsigned char tmp_etcflag; + unsigned char prev_etcflag = 0; + while (spNode->Read(*this, flag)) + { + if( !(spNode->etcflag & 0x04) ){ + tmp_etcflag = spNode->etcflag; + spNode->etcflag = prev_etcflag; + prev_etcflag = tmp_etcflag; + } + if (spNode->nch && spNode->reuse_shape) + { + if (!aplist.empty()){ + spNode->pshape = aplist.back()->pshape; + } + else{ + spNode->nch = 0; + spNode->reuse_shape = 0; + } + } + spNode->pshape->pagebreak = spNode->etcflag; + if (spNode->nch) + AddParaShape(spNode->pshape); + + if (!aplist.empty()) + aplist.back()->SetNext(spNode.get()); + aplist.push_back(std::move(spNode)); + spNode.reset( new HWPPara ); + } + + return true; +} + void HWPFile::TagsRead() { while (true) |