summaryrefslogtreecommitdiffstats
path: root/hwpfilter/source/hwpread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'hwpfilter/source/hwpread.cxx')
-rw-r--r--hwpfilter/source/hwpread.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 1ed8001513af..7e0564b187a4 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)
@@ -424,6 +426,7 @@ bool Picture::Read(HWPFile & hwpf)
scale[1] = tmp16;
hwpf.ReadBlock(picinfo.picun.path, 256); /* Picture File Name: when type is not a Drawing. */
+ picinfo.picun.path[255] = 0; // ensure null terminated
hwpf.ReadBlock(reserved3, 9); /* Brightness / Contrast / Picture Effect, etc. */
UpdateBBox(this);
@@ -463,7 +466,7 @@ bool Picture::Read(HWPFile & hwpf)
HMemIODev* pOldMem = hmem;
HMemIODev* pNewMem = new HMemIODev(reinterpret_cast<char *>(follow.data()), follow_block_size);
hmem = pNewMem;
- LoadDrawingObjectBlock(this);
+ LoadDrawingObjectBlock(this, hwpf);
style.cell = picinfo.picdraw.hdo;
assert(hmem == pNewMem);
delete pNewMem;
@@ -482,12 +485,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 +530,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 +558,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)