summaryrefslogtreecommitdiffstats
path: root/hwpfilter/source/hpara.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'hwpfilter/source/hpara.cxx')
-rw-r--r--hwpfilter/source/hpara.cxx28
1 files changed, 13 insertions, 15 deletions
diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx
index 736188f1ad9e..4cddf7d76ad7 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -31,30 +31,30 @@
void LineInfo::Read(HWPFile & hwpf, HWPPara const *pPara)
{
- if (!hwpf.Read2b(pos))
- return;
unsigned short tmp16;
if (!hwpf.Read2b(tmp16))
return;
- space_width = tmp16;
+ // unused field is "pos" "Starting character position"
+ if (!hwpf.Read2b(tmp16))
+ return;
+ // unused field is "space_width"
if (!hwpf.Read2b(tmp16))
return;
- height = tmp16;
-// internal information
+ // unused field is "height"
+ // internal information
if (!hwpf.Read2b(tmp16))
return;
pgy = tmp16;
if (!hwpf.Read2b(tmp16))
return;
- sx = tmp16;
+ // unused field is "sx"
if (!hwpf.Read2b(tmp16))
return;
- psx = tmp16;
+ // unused field is "psx"
if (!hwpf.Read2b(tmp16))
return;
- pex = tmp16;
- height_sp = 0;
+ hunit pex = tmp16;
if( pex >> 15 & 0x01 )
{
if (pex & 0x01)
@@ -78,7 +78,6 @@ HWPPara::HWPPara()
, cshape(std::make_shared<CharShape>())
, pshape(std::make_shared<ParaShape>())
{
- memset(cshape.get(), 0, sizeof(CharShape));
}
HWPPara::~HWPPara()
@@ -145,7 +144,6 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
for (ii = 0; ii < nch; ii++)
{
cshapep[ii] = std::make_shared<CharShape>();
- memset(cshapep[ii].get(), 0, sizeof(CharShape));
unsigned char same_cshape(0);
hwpf.Read1b(same_cshape);
@@ -168,12 +166,12 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
auto hBox = readHBox(hwpf);
if (!hBox)
return false;
- hhstr[ii] = std::move(hBox);
- if (hhstr[ii]->hh == CH_END_PARA)
+ hhstr.emplace_back(std::move(hBox));
+ if (hhstr.back()->hh == CH_END_PARA)
break;
- if( hhstr[ii]->hh < CH_END_PARA )
+ if( hhstr.back()->hh < CH_END_PARA )
pshape->reserved[0] = 0;
- ii += hhstr[ii]->WSize();
+ ii += hhstr.back()->WSize();
}
return nch && !hwpf.State();
}