summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-11 13:31:05 +0200
committerNoel Grandin <noel@peralex.com>2016-01-11 13:49:59 +0200
commitbdeb15881f2439665ec52bbfe7f55712eb57c163 (patch)
treea387f5c1594abc9ad068228d81b09c1c5bbd8eb1 /hwpfilter
parent0f3a3c38bb4e7c4b4717e8dd7999fecba1288275 (diff)
loplugin:unusedmethods unused return value in hwpfilter
Change-Id: Ib225db89e60708f6b55b3cb86f8e881386fab86f
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/formula.cxx6
-rw-r--r--hwpfilter/source/formula.h2
-rw-r--r--hwpfilter/source/hfont.cxx7
-rw-r--r--hwpfilter/source/hfont.h2
-rw-r--r--hwpfilter/source/hinfo.cxx29
-rw-r--r--hwpfilter/source/hinfo.h4
-rw-r--r--hwpfilter/source/hpara.cxx18
-rw-r--r--hwpfilter/source/hpara.h2
-rw-r--r--hwpfilter/source/htags.cxx19
-rw-r--r--hwpfilter/source/htags.h4
-rw-r--r--hwpfilter/source/hwpfile.cxx31
-rw-r--r--hwpfilter/source/hwpfile.h14
12 files changed, 65 insertions, 73 deletions
diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx
index d12c6cbce0ab..0022efe1f8ca 100644
--- a/hwpfilter/source/formula.cxx
+++ b/hwpfilter/source/formula.cxx
@@ -568,10 +568,10 @@ void Formula::makeBlock(Node *res)
#endif
}
-int Formula::parse()
+void Formula::parse()
{
Node *res = nullptr;
- if( !eq ) return 0;
+ if( !eq ) return;
if( isHwpEQ ){
MzString a;
// fprintf(stderr,"\n\n[BEFORE]\n[%s]\n",eq);
@@ -627,8 +627,6 @@ int Formula::parse()
nodelist.pop_front();
delete tmpNode;
}
-
- return 0;
}
void Formula::trim()
diff --git a/hwpfilter/source/formula.h b/hwpfilter/source/formula.h
index 22c53f6a4d6f..a4cddc2e8c8a 100644
--- a/hwpfilter/source/formula.h
+++ b/hwpfilter/source/formula.h
@@ -55,7 +55,7 @@ public:
pList = p;
rList = static_cast<XAttributeList *>(pList);
}
- int parse();
+ void parse();
private:
void trim();
void makeMathML(Node *res);
diff --git a/hwpfilter/source/hfont.cxx b/hwpfilter/source/hfont.cxx
index 72746f23467e..a530f1272c06 100644
--- a/hwpfilter/source/hfont.cxx
+++ b/hwpfilter/source/hfont.cxx
@@ -43,18 +43,17 @@ HWPFont::~HWPFont()
}
-int HWPFont::AddFont(int lang, const char *font)
+void HWPFont::AddFont(int lang, const char *font)
{
int nfonts;
if (!(lang >= 0 && lang < NLanguage))
- return 0;
+ return;
nfonts = nFonts[lang];
if (MAXFONTS <= nfonts)
- return 0;
+ return;
strncpy(fontnames[lang] + FONTNAMELEN * nfonts, font, FONTNAMELEN - 1);
nFonts[lang]++;
- return nfonts;
}
diff --git a/hwpfilter/source/hfont.h b/hwpfilter/source/hfont.h
index 1ed8fa6bb3cd..39aa159ee49e 100644
--- a/hwpfilter/source/hfont.h
+++ b/hwpfilter/source/hfont.h
@@ -54,7 +54,7 @@ class DLLEXPORT HWPFont
* @param lang Language index
* @param font Name of font family
*/
- int AddFont( int lang, const char *font );
+ void AddFont( int lang, const char *font );
/**
* @param lang Language index
* @param id Index of font
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 2ca1714045f1..b9d75a695a34 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -197,24 +197,24 @@ bool HWPSummary::Read(HWPFile & hwpf)
}
-bool ParaShape::Read(HWPFile & hwpf)
+void ParaShape::Read(HWPFile & hwpf)
{
pagebreak = 0;
unsigned short tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
left_margin = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
right_margin = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
indent = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
lspacing = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
pspacing_next = tmp16;
hwpf.Read1b(&condense, 1);
@@ -224,37 +224,36 @@ bool ParaShape::Read(HWPFile & hwpf)
hwpf.Read1b(&tabs[ii].type, 1);
hwpf.Read1b(&tabs[ii].dot_continue, 1);
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
tabs[ii].position = tmp16;
}
hwpf.Read1b(&coldef.ncols, 1);
hwpf.Read1b(&coldef.separator, 1);
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
coldef.spacing = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
coldef.columnlen = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
coldef.columnlen0 = tmp16;
hwpf.Read1b(&shade, 1);
hwpf.Read1b(&outline, 1);
hwpf.Read1b(&outline_continue, 1);
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
pspacing_prev = tmp16;
hwpf.Read1b(reserved, 2);
- return (!hwpf.State());
}
-bool CharShape::Read(HWPFile & hwpf)
+void CharShape::Read(HWPFile & hwpf)
{
unsigned short tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
size = tmp16;
hwpf.Read1b(font, NLanguage);
hwpf.Read1b(ratio, NLanguage);
@@ -263,8 +262,6 @@ bool CharShape::Read(HWPFile & hwpf)
hwpf.Read1b(&shade, 1);
hwpf.Read1b(&attr, 1);
hwpf.Read1b(reserved, 4);
-
- return (!hwpf.State());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index 565e6a1cb54f..884c0894fa92 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -231,7 +231,7 @@ struct CharShape
unsigned char attr;
unsigned char reserved[4];
- bool Read(HWPFile &);
+ void Read(HWPFile &);
};
/* ?? ?????? ???? ?????? */
@@ -284,7 +284,7 @@ struct ParaShape
CharShape *cshape;
unsigned char pagebreak;
- bool Read(HWPFile &);
+ void Read(HWPFile &);
// virtual ~ParaShape();
};
#endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H
diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx
index 7b474bdba72d..9bbd9a3da8d4 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -29,29 +29,29 @@
#include "hbox.h"
#include "hutil.h"
-bool LineInfo::Read(HWPFile & hwpf, HWPPara *pPara)
+void LineInfo::Read(HWPFile & hwpf, HWPPara *pPara)
{
if (!hwpf.Read2b(pos))
- return false;
+ return;
unsigned short tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
space_width = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
height = tmp16;
// internal information
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
pgy = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
sx = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
psx = tmp16;
if (!hwpf.Read2b(tmp16))
- return false;
+ return;
pex = tmp16;
height_sp = 0;
@@ -62,8 +62,6 @@ bool LineInfo::Read(HWPFile & hwpf, HWPPara *pPara)
pPara->pshape.reserved[0] = sal::static_int_cast<unsigned char>(pex & 0x01);
pPara->pshape.reserved[1] = sal::static_int_cast<unsigned char>(pex & 0x02);
}
-
- return (!hwpf.State());
}
HWPPara::HWPPara()
diff --git a/hwpfilter/source/hpara.h b/hwpfilter/source/hpara.h
index e9886656abc9..343f08afafde 100644
--- a/hwpfilter/source/hpara.h
+++ b/hwpfilter/source/hpara.h
@@ -68,7 +68,7 @@ struct LineInfo
hunit height_sp;
unsigned short softbreak; // column, page, section
- bool Read(HWPFile &hwpf, HWPPara *para);
+ void Read(HWPFile &hwpf, HWPPara *para);
};
/**
* It represents the paragraph.
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx
index eb49626baa34..3bc004a89d26 100644
--- a/hwpfilter/source/htags.cxx
+++ b/hwpfilter/source/htags.cxx
@@ -25,7 +25,7 @@
#include "hwpfile.h"
#include "htags.h"
-bool HyperText::Read(HWPFile & hwpf)
+void HyperText::Read(HWPFile & hwpf)
{
hwpf.Read1b(filename, 256);
hwpf.Read2b(bookmark, 16);
@@ -41,7 +41,6 @@ bool HyperText::Read(HWPFile & hwpf)
break;
}
}
- return true;
}
@@ -101,21 +100,21 @@ OlePicture::~OlePicture()
#define FILESTG_SIGNATURE_NORMAL 0xF8995568
-bool OlePicture::Read(HWPFile & hwpf)
+void OlePicture::Read(HWPFile & hwpf)
{
if (size <= 0)
- return false;
+ return;
// We process only FILESTG_SIGNATURE_NORMAL.
hwpf.Read4b(&signature, 1);
if (signature != FILESTG_SIGNATURE_NORMAL)
- return false;
+ return;
#ifdef WIN32
char *data = new char[size];
if (hwpf.ReadBlock(data,size) == 0)
{
delete [] data;
- return false;
+ return;
}
FILE *fp;
char tname[200];
@@ -124,7 +123,7 @@ bool OlePicture::Read(HWPFile & hwpf)
if (0 == (fp = fopen(tname, "wb")))
{
delete [] data;
- return false;
+ return;
}
fwrite(data, size, 1, fp);
delete [] data;
@@ -135,15 +134,13 @@ bool OlePicture::Read(HWPFile & hwpf)
NULL, 0, &pis) != S_OK ) {
pis = 0;
unlink(tname);
- return false;
+ return;
}
unlink(tname);
#else
if (pis == nullptr || hwpf.ReadBlock(pis, size) == 0)
- return false;
+ return;
#endif
-
- return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h
index 303b84461c9e..2e07978d23b5 100644
--- a/hwpfilter/source/htags.h
+++ b/hwpfilter/source/htags.h
@@ -46,7 +46,7 @@ struct HyperText
char macro[325];
uchar type;
char reserve[3];
- bool Read(HWPFile& hwpf);
+ void Read(HWPFile& hwpf);
};
/**
* @short Win32 OLE object
@@ -63,7 +63,7 @@ struct OlePicture
explicit OlePicture(int tsize);
~OlePicture(void);
- bool Read(HWPFile& hwpf);
+ void Read(HWPFile& hwpf);
};
#endif // INCLUDED_HWPFILTER_SOURCE_HTAGS_H
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 1d7eb841882d..fb989ad3476f 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -176,15 +176,17 @@ int HWPFile::Read1b(void *ptr, size_t nmemb)
return hiodev ? hiodev->read1b(ptr, nmemb) : 0;
}
-int HWPFile::Read2b(void *ptr, size_t nmemb)
+void HWPFile::Read2b(void *ptr, size_t nmemb)
{
- return hiodev ? hiodev->read2b(ptr, nmemb) : 0;
+ if (hiodev)
+ hiodev->read2b(ptr, nmemb);
}
-int HWPFile::Read4b(void *ptr, size_t nmemb)
+void HWPFile::Read4b(void *ptr, size_t nmemb)
{
- return hiodev ? hiodev->read4b(ptr, nmemb) : 0;
+ if (hiodev)
+ hiodev->read4b(ptr, nmemb);
}
@@ -200,9 +202,10 @@ size_t HWPFile::SkipBlock(size_t size)
}
-bool HWPFile::SetCompressed(bool flag)
+void HWPFile::SetCompressed(bool flag)
{
- return hiodev && hiodev->setCompressed(flag);
+ if (hiodev)
+ hiodev->setCompressed(flag);
}
@@ -218,27 +221,27 @@ HIODev *HWPFile::SetIODevice(HIODev * new_hiodev)
// end of HIODev wrapper
-bool HWPFile::InfoRead()
+void HWPFile::InfoRead()
{
- return _hwpInfo.Read(*this);
+ _hwpInfo.Read(*this);
}
-bool HWPFile::FontRead()
+void HWPFile::FontRead()
{
- return _hwpFont.Read(*this);
+ _hwpFont.Read(*this);
}
-bool HWPFile::StyleRead()
+void HWPFile::StyleRead()
{
- return _hwpStyle.Read(*this);
+ _hwpStyle.Read(*this);
}
-bool HWPFile::ParaListRead()
+void HWPFile::ParaListRead()
{
- return ReadParaList(plist);
+ ReadParaList(plist);
}
bool HWPFile::ReadParaList(std::list < HWPPara* > &aplist, unsigned char flag)
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index ea500e10bba7..497593f5fb80 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -142,11 +142,11 @@ class DLLEXPORT HWPFile
/**
* Reads nmemb short type array from HIODev
*/
- int Read2b( void *ptr, size_t nmemb );
+ void Read2b( void *ptr, size_t nmemb );
/**
* Reads nmemb long type array from HIODev
*/
- int Read4b( void *ptr, size_t nmemb );
+ void Read4b( void *ptr, size_t nmemb );
/**
* Reads some bytes from HIODev not regarding endian's way
* @param size Amount for reading
@@ -163,7 +163,7 @@ class DLLEXPORT HWPFile
/**
* Sets if the stream is compressed
*/
- bool SetCompressed( bool );
+ void SetCompressed( bool );
/**
* Sets current HIODev
*/
@@ -176,19 +176,19 @@ class DLLEXPORT HWPFile
/**
* Reads document information of hwp file from HIODev
*/
- bool InfoRead(void);
+ void InfoRead(void);
/**
* Reads font list of hwp file from HIODev
*/
- bool FontRead(void);
+ void FontRead(void);
/**
* Reads style list of hwp file from HIODev
*/
- bool StyleRead(void);
+ void StyleRead(void);
/**
* Reads paragraph list of hwp file from HIODev
*/
- bool ParaListRead();
+ void ParaListRead();
/* 그림 등의 추가 정보를 읽는다. */
/**
* Reads additional information like embedded image of hwp file from HIODev