diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-22 16:09:53 +0000 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-02-23 13:28:53 +0100 |
commit | a2ba9119d941fa4383bf41da0d55b3373218b68f (patch) | |
tree | b3711dff456c6e0d2952dbb731f3bac5adc44d96 | |
parent | cd1393acfc0065a8e8cbe85bb7b29dab64bc8d89 (diff) |
keep paragraph's that failed to load until import is complete
LIBREOFFICE-509JU93T
Change-Id: I526edb182fed4fa023cce58e78a650a7c2046ed3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130367
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hwpfile.h | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 171b7e1a9e8d..4ff62fa9db30 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -238,6 +238,7 @@ void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist) aplist.push_back(spNode.release()); spNode.reset( new HWPPara ); } + pfailedlist.push_back(std::move(spNode)); } void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsigned char flag) @@ -271,6 +272,7 @@ void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsi aplist.push_back(std::move(spNode)); spNode.reset( new HWPPara ); } + pfailedlist.push_back(std::move(spNode)); } void HWPFile::TagsRead() diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h index 867a05fb7418..4e92185a11eb 100644 --- a/hwpfilter/source/hwpfile.h +++ b/hwpfilter/source/hwpfile.h @@ -280,6 +280,10 @@ class DLLEXPORT HWPFile std::vector<std::unique_ptr<ColumnInfo>> columnlist; // paragraph list std::vector<std::unique_ptr<HWPPara>> plist; + // keep paragraph's that failed to load until + // import is complete to avoid dangling references + // elsewhere + std::vector<std::unique_ptr<HWPPara>> pfailedlist; // floating box list std::vector<FBox*> blist; // embedded picture list(tag data) |