fix ODR violation

which causes a segfault in CppunitTest_hwpfilter_test_hwpfilter when
building with --enable-mergelibs=more

Change-Id: I4310060e28ee092bf7831d5dfd71e98ad3724bbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164177
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-03-01 08:54:29 +02:00
parent 4ed91fc721
commit 37bc6ca4bb
2 changed files with 5 additions and 5 deletions

View File

@@ -566,13 +566,13 @@ void HWPFile::AddCharShape(std::shared_ptr<CharShape> const & cshape)
void HWPFile::AddColumnInfo() void HWPFile::AddColumnInfo()
{ {
columnlist.emplace_back(new ColumnInfo(m_nCurrentPage)); columnlist.emplace_back(new HWPColumnInfo(m_nCurrentPage));
setMaxSettedPage(); setMaxSettedPage();
} }
void HWPFile::SetColumnDef(const std::shared_ptr<ColumnDef>& rColdef) void HWPFile::SetColumnDef(const std::shared_ptr<ColumnDef>& rColdef)
{ {
ColumnInfo *cinfo = columnlist.back().get(); HWPColumnInfo *cinfo = columnlist.back().get();
if( cinfo->bIsSet ) if( cinfo->bIsSet )
return; return;
cinfo->xColdef = rColdef; cinfo->xColdef = rColdef;

View File

@@ -68,11 +68,11 @@ class HWPStyle;
class HWPPara; class HWPPara;
class HStream; class HStream;
struct ColumnInfo{ struct HWPColumnInfo{
int start_page; int start_page;
bool bIsSet; bool bIsSet;
std::shared_ptr<ColumnDef> xColdef; std::shared_ptr<ColumnDef> xColdef;
explicit ColumnInfo(int num){ explicit HWPColumnInfo(int num){
start_page = num; start_page = num;
bIsSet = false; bIsSet = false;
} }
@@ -279,7 +279,7 @@ class DLLEXPORT HWPFile
HWPInfo _hwpInfo; HWPInfo _hwpInfo;
HWPFont _hwpFont; HWPFont _hwpFont;
HWPStyle _hwpStyle; HWPStyle _hwpStyle;
std::vector<std::unique_ptr<ColumnInfo>> columnlist; std::vector<std::unique_ptr<HWPColumnInfo>> columnlist;
// paragraph list // paragraph list
std::vector<std::unique_ptr<HWPPara>> plist; std::vector<std::unique_ptr<HWPPara>> plist;
// keep paragraph's that failed to load until // keep paragraph's that failed to load until