hwpfilter/source/hwpfile.cxx |    2 ++
 hwpfilter/source/hwpfile.h   |    4 ++++
 2 files changed, 6 insertions(+)

New commits:
commit ab3aaafb75c7f9e65eddf0ecefa59e30268cd04e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 22 16:09:53 2022 +0000
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Mar 2 14:48:40 2022 +0100

    keep paragraph's that failed to load until import is complete
    
    LIBREOFFICE-509JU93T
    
    Change-Id: I526edb182fed4fa023cce58e78a650a7c2046ed3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130368
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 8be445919ed4..13ce581b2266 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -244,6 +244,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)
@@ -277,6 +278,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 9cc3b72a7c65..f5f30d925416 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -283,6 +283,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)

Reply via email to