summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-18 10:39:48 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-18 12:50:09 +0000
commita7f6efc68ba97db98ebab9ebc473bffb8ded757f (patch)
treebad37ce9ee1c9f61f1c8541a9689ecdea8c84c08 /hwpfilter
parenta08745551370a052bfb6b91335956ababf435791 (diff)
loplugin: unused return values
Change-Id: I9c61a46c57894bc63a57740206c0bcb4a16553af Reviewed-on: https://gerrit.libreoffice.org/21571 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hfont.cxx7
-rw-r--r--hwpfilter/source/hfont.h2
-rw-r--r--hwpfilter/source/hinfo.cxx36
-rw-r--r--hwpfilter/source/hinfo.h2
-rw-r--r--hwpfilter/source/hstyle.cxx7
-rw-r--r--hwpfilter/source/hstyle.h2
6 files changed, 26 insertions, 30 deletions
diff --git a/hwpfilter/source/hfont.cxx b/hwpfilter/source/hfont.cxx
index a530f1272c06..a16905cda66c 100644
--- a/hwpfilter/source/hfont.cxx
+++ b/hwpfilter/source/hfont.cxx
@@ -69,7 +69,7 @@ const char *HWPFont::GetFontName(int lang, int id)
static char buffer[FONTNAMELEN];
-bool HWPFont::Read(HWPFile & hwpf)
+void HWPFont::Read(HWPFile & hwpf)
{
int lang = 0;
short nfonts = 0;
@@ -80,7 +80,8 @@ bool HWPFont::Read(HWPFile & hwpf)
hwpf.Read2b(&nfonts, 1);
if (!(nfonts > 0 && nfonts < MAXFONTS))
{
- return !hwpf.SetState(HWP_InvalidFileFormat);
+ hwpf.SetState(HWP_InvalidFileFormat);
+ return;
}
fontnames[lang] = new char[nfonts * FONTNAMELEN];
@@ -91,8 +92,6 @@ bool HWPFont::Read(HWPFile & hwpf)
AddFont(lang, buffer);
}
}
-
- return !hwpf.State();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hfont.h b/hwpfilter/source/hfont.h
index 39aa159ee49e..074346f8f892 100644
--- a/hwpfilter/source/hfont.h
+++ b/hwpfilter/source/hfont.h
@@ -62,7 +62,7 @@ class DLLEXPORT HWPFont
*/
const char *GetFontName( int lang, int id );
- bool Read( HWPFile &hwpf );
+ void Read( HWPFile &hwpf );
};
#endif /* _HWPFONTS+H_ */
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index b9d75a695a34..241ab2f80304 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -75,7 +75,7 @@ HWPInfo::~HWPInfo()
* Function for reading document information (128 bytes)
* Document information is the information after the file identification information (30 bytes).
*/
-bool HWPInfo::Read(HWPFile & hwpf)
+void HWPInfo::Read(HWPFile & hwpf)
{
hwpf.Read2b(&cur_col, 1); /* When a document is saving, the paragraph number where the coursor is */
hwpf.Read2b(&cur_row, 1); /* Paragraphs rows */
@@ -86,31 +86,31 @@ bool HWPInfo::Read(HWPFile & hwpf)
// paper geometry information
unsigned short tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.paper_height = tmp16; /* Paper length */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.paper_width = tmp16; /* Sheet width */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.top_margin = tmp16; /* Top margin */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.bottom_margin = tmp16; /* The bottom margin */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.left_margin = tmp16; /* Left Margin */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.right_margin = tmp16; /* Right margins */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.header_length = tmp16; /* Header length */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.footer_length = tmp16; /* Footer length */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
paper.gutter_length = tmp16; /* The binding margin */
hwpf.Read2b(&readonly, 1); /* Reserve */
hwpf.Read1b(reserved1, 4); /* Reserve */
@@ -129,13 +129,13 @@ bool HWPInfo::Read(HWPFile & hwpf)
hwpf.Read2b(&countfn,1); /* Number of footnote */
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
splinetext = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
splinefn = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
spfnfn = tmp16;
hwpf.Read1b(&fnchar, 1);
hwpf.Read1b(&fnlinetype, 1);
@@ -143,7 +143,7 @@ bool HWPInfo::Read(HWPFile & hwpf)
for (int ii = 0; ii < 4; ++ii)
{
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
bordermargin[ii] = tmp16;
}
hwpf.Read2b(&borderline, 1);
@@ -156,17 +156,17 @@ bool HWPInfo::Read(HWPFile & hwpf)
hwpf.Read2b(&info_block_len, 1);
if (hwpf.State())
- return false;
+ return;
/* Read the article summary. */
if (!summary.Read(hwpf))
- return false;
+ return;
if (info_block_len > 0)
{
info_block = new unsigned char[info_block_len + 1];
if (!HWPReadInfoBlock(info_block, info_block_len, hwpf))
- return false;
+ return;
}
/* reset the value of hwpf. */
@@ -174,8 +174,6 @@ bool HWPInfo::Read(HWPFile & hwpf)
hwpf.encrypted = encrypted != 0;
hwpf.info_block_len = info_block_len;
hwpf.SetCompressed(hwpf.compressed);
-
- return (!hwpf.State());
}
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index 884c0894fa92..b080150e30c8 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -205,7 +205,7 @@ class DLLEXPORT HWPInfo
HWPInfo(void);
~HWPInfo(void);
- bool Read(HWPFile &hwpf);
+ void Read(HWPFile &hwpf);
};
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index cc7734cec83d..f2ba4b28d808 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -115,7 +115,7 @@ void HWPStyle::SetParaShape(int n, ParaShape * pshapep)
}
-bool HWPStyle::Read(HWPFile & hwpf)
+void HWPStyle::Read(HWPFile & hwpf)
{
CharShape cshape;
ParaShape pshape;
@@ -123,7 +123,7 @@ bool HWPStyle::Read(HWPFile & hwpf)
hwpf.Read2b(&nstyles, 1);
style = ::comphelper::newArray_null<StyleData>(nstyles);
if (!style)
- return false;
+ return;
for (int ii = 0; ii < nstyles; ii++)
{
@@ -135,9 +135,8 @@ bool HWPStyle::Read(HWPFile & hwpf)
SetCharShape(ii, &cshape);
SetParaShape(ii, &pshape);
if (hwpf.State())
- return false;
+ return;
}
- return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hstyle.h b/hwpfilter/source/hstyle.h
index 443102983535..c13523061a74 100644
--- a/hwpfilter/source/hstyle.h
+++ b/hwpfilter/source/hstyle.h
@@ -45,7 +45,7 @@ class DLLEXPORT HWPStyle
void SetCharShape( int n, CharShape *cshapep );
void SetParaShape( int n, ParaShape *pshapep );
- bool Read( HWPFile &hwpf );
+ void Read( HWPFile &hwpf );
};
#endif
/* _HWPSTYLE+H_ */