diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-01 10:18:51 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-03 13:38:07 +0100 |
commit | 24ee70d29362e15b8bc9d5e4b90afccd7cbe5320 (patch) | |
tree | 7c1e682e7471f530201dcb29dfb3f42882c9edf5 | |
parent | ofz#44991 keep paragraph's that failed to load until import is complete (diff) | |
download | core-24ee70d29362e15b8bc9d5e4b90afccd7cbe5320.tar.gz core-24ee70d29362e15b8bc9d5e4b90afccd7cbe5320.zip |
ofz: don't register style if hbox load failed
Change-Id: I4d9d5d76f0c2385871003720e933ed1926f66c70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130771
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit 3ac009bfec614ece98313c6444b4c1183ff14954)
(cherry picked from commit 8abce17e43858d85325f05cb46d0b8d717356919)
-rw-r--r-- | hwpfilter/source/hwpread.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx index 906246b2b69c..1ef27f7c243f 100644 --- a/hwpfilter/source/hwpread.cxx +++ b/hwpfilter/source/hwpread.cxx @@ -233,7 +233,6 @@ bool TxtBox::Read(HWPFile & hwpf) hwpf.Read2b(&option, 1); hwpf.Read2b(&ctrl_ch, 1); hwpf.Read2b(style.margin, 12); - hwpf.AddFBoxStyle(&style); hwpf.Read2b(&box_xs, 1); hwpf.Read2b(&box_ys, 1); hwpf.Read2b(&cap_xs, 1); @@ -361,7 +360,10 @@ bool TxtBox::Read(HWPFile & hwpf) else m_pTable = nullptr; - return !hwpf.State(); + bSuccess = !hwpf.State(); + if (bSuccess) + hwpf.AddFBoxStyle(&style); + return bSuccess; } // picture(11) @@ -482,12 +484,14 @@ bool Picture::Read(HWPFile & hwpf) style.boxtype = 'G'; else style.boxtype = 'D'; - hwpf.AddFBoxStyle(&style); // caption hwpf.ReadParaList(caption); - return !hwpf.State(); + bool bSuccess = !hwpf.State(); + if (bSuccess) + hwpf.AddFBoxStyle(&style); + return bSuccess; } // line(15) @@ -525,7 +529,6 @@ bool Line::Read(HWPFile & hwpf) hwpf.Read2b(&option, 1); hwpf.Read2b(&ctrl_ch, 1); hwpf.Read2b(style.margin, 12); - hwpf.AddFBoxStyle(&style); hwpf.Read2b(&box_xs, 1); hwpf.Read2b(&box_ys, 1); hwpf.Read2b(&cap_xs, 1); @@ -554,7 +557,10 @@ bool Line::Read(HWPFile & hwpf) hwpf.Read2b(&color, 1); style.xpos = width; - return !hwpf.State(); + bool bSuccess = !hwpf.State(); + if (bSuccess) + hwpf.AddFBoxStyle(&style); + return bSuccess; } // hidden(15) |