summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hwpfilter/source/hwpfile.cxx2
-rw-r--r--hwpfilter/source/hwpfile.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 8f221c743a43..3656da012c18 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -241,6 +241,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)
@@ -274,6 +275,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 88e2151a5c9a..539c1b401c45 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -284,6 +284,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 datas)