From 3ccaa4d9e9e18555e86e111259a4908413d36718 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 17 Jul 2017 11:04:02 +0200 Subject: loplugin:constparams in scaddins,hwpfilter Change-Id: I91b3559b9c3f5d8837d182cf9406fad9aeee78b3 Reviewed-on: https://gerrit.libreoffice.org/40049 Tested-by: Jenkins Reviewed-by: Noel Grandin --- hwpfilter/source/hpara.cxx | 2 +- hwpfilter/source/hpara.h | 2 +- hwpfilter/source/hstyle.cxx | 6 +++--- hwpfilter/source/hstyle.h | 6 +++--- hwpfilter/source/hwpeq.cxx | 8 ++++---- hwpfilter/source/hwpeq.h | 2 +- hwpfilter/source/hwpfile.cxx | 8 ++++---- hwpfilter/source/hwpfile.h | 8 ++++---- hwpfilter/source/hwpreader.cxx | 6 +++--- hwpfilter/source/hwpreader.hxx | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) (limited to 'hwpfilter/source') diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx index 5d9dd47c3d24..6b43c3bbf827 100644 --- a/hwpfilter/source/hpara.cxx +++ b/hwpfilter/source/hpara.cxx @@ -29,7 +29,7 @@ #include "hbox.h" #include "hutil.h" -void LineInfo::Read(HWPFile & hwpf, HWPPara *pPara) +void LineInfo::Read(HWPFile & hwpf, HWPPara const *pPara) { if (!hwpf.Read2b(pos)) return; diff --git a/hwpfilter/source/hpara.h b/hwpfilter/source/hpara.h index 55af7e98120b..894e81ffd137 100644 --- a/hwpfilter/source/hpara.h +++ b/hwpfilter/source/hpara.h @@ -69,7 +69,7 @@ struct LineInfo hunit height_sp; unsigned short softbreak; // column, page, section - void Read(HWPFile &hwpf, HWPPara *para); + void Read(HWPFile &hwpf, HWPPara const *para); }; /** * It represents the paragraph. diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx index d43b3c8fc785..cc3ef07cc987 100644 --- a/hwpfilter/source/hstyle.cxx +++ b/hwpfilter/source/hstyle.cxx @@ -61,7 +61,7 @@ char *HWPStyle::GetName(int n) const } -void HWPStyle::SetName(int n, char *name) +void HWPStyle::SetName(int n, char const *name) { if (n >= 0 && n < nstyles) { @@ -81,7 +81,7 @@ CharShape *HWPStyle::GetCharShape(int n) const } -void HWPStyle::SetCharShape(int n, CharShape * cshapep) +void HWPStyle::SetCharShape(int n, CharShape const * cshapep) { if (n >= 0 && n < nstyles) { @@ -101,7 +101,7 @@ ParaShape *HWPStyle::GetParaShape(int n) const } -void HWPStyle::SetParaShape(int n, ParaShape * pshapep) +void HWPStyle::SetParaShape(int n, ParaShape const * pshapep) { if (n >= 0 && n < nstyles) { diff --git a/hwpfilter/source/hstyle.h b/hwpfilter/source/hstyle.h index c13523061a74..98b38a4a1840 100644 --- a/hwpfilter/source/hstyle.h +++ b/hwpfilter/source/hstyle.h @@ -41,9 +41,9 @@ class DLLEXPORT HWPStyle CharShape *GetCharShape( int n ) const; ParaShape *GetParaShape( int n ) const; - void SetName( int n, char *name ); - void SetCharShape( int n, CharShape *cshapep ); - void SetParaShape( int n, ParaShape *pshapep ); + void SetName( int n, char const *name ); + void SetCharShape( int n, CharShape const *cshapep ); + void SetParaShape( int n, ParaShape const *pshapep ); void Read( HWPFile &hwpf ); }; diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx index 519a4457dc03..5be9ad7c2603 100644 --- a/hwpfilter/source/hwpeq.cxx +++ b/hwpfilter/source/hwpeq.cxx @@ -388,7 +388,7 @@ static const hwpeq eq_tbl[] = { { "zeta", nullptr, 0, EQ_CASE } }; -static const hwpeq *lookup_eqn(char *str) +static const hwpeq *lookup_eqn(char const *str) { static const int eqCount = SAL_N_ELEMENTS(eq_tbl); int l = 0, r = eqCount; @@ -459,7 +459,7 @@ struct eq_stack { istream *strm; eq_stack() { strm = nullptr; }; - bool state(istream *s) { + bool state(istream const *s) { if( strm != s) { white = nullptr; token = nullptr; } return token.length() != 0; } @@ -467,7 +467,7 @@ struct eq_stack { static eq_stack *stk = nullptr; -void push_token(MzString &white, MzString &token, istream *strm) +void push_token(MzString const &white, MzString const &token, istream *strm) { // one time stack assert(stk->token.length() == 0); @@ -749,7 +749,7 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel) return token[0]; } -void eq2latex(MzString& outs, char *s) +void eq2latex(MzString& outs, char const *s) { assert(s); if( stk == nullptr ) diff --git a/hwpfilter/source/hwpeq.h b/hwpfilter/source/hwpeq.h index f5ab84a557fe..07e62ab7f985 100644 --- a/hwpfilter/source/hwpeq.h +++ b/hwpfilter/source/hwpeq.h @@ -22,7 +22,7 @@ #include "mzstring.h" -void eq2latex(MzString &mstr, char *str); +void eq2latex(MzString &mstr, char const *str); #endif // INCLUDED_HWPFILTER_SOURCE_HWPEQ_H diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 8507b5056e20..43fad53c3829 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -520,7 +520,7 @@ Table *HWPFile::getTable(int index) return tables[index]; } -void HWPFile::AddParaShape(std::shared_ptr& pshape) +void HWPFile::AddParaShape(std::shared_ptr const & pshape) { int nscount = 0; for(int j = 0 ; j < MAXTABS-1 ; j++) @@ -552,7 +552,7 @@ void HWPFile::AddParaShape(std::shared_ptr& pshape) pshape->index = value; } -void HWPFile::AddCharShape(std::shared_ptr& cshape) +void HWPFile::AddCharShape(std::shared_ptr const & cshape) { int value = compareCharShape(cshape.get()); if (value == 0) @@ -606,7 +606,7 @@ void HWPFile::AddFBoxStyle(FBoxStyle * fbstyle) fbslist.push_back(fbstyle); } -int HWPFile::compareCharShape(CharShape *shape) +int HWPFile::compareCharShape(CharShape const *shape) { int count = cslist.size(); if( count > 0 ) @@ -632,7 +632,7 @@ int HWPFile::compareCharShape(CharShape *shape) } -int HWPFile::compareParaShape(ParaShape *shape) +int HWPFile::compareParaShape(ParaShape const *shape) { int count = pslist.size(); if( count > 0 ) diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h index e86d5bd60663..75f17d19a448 100644 --- a/hwpfilter/source/hwpfile.h +++ b/hwpfilter/source/hwpfile.h @@ -212,8 +212,8 @@ class DLLEXPORT HWPFile void AddPage(){ m_nCurrentPage++;} void AddColumnInfo(); void SetColumnDef(ColumnDef *coldef); - void AddParaShape(std::shared_ptr&); - void AddCharShape(std::shared_ptr&); + void AddParaShape(std::shared_ptr const &); + void AddCharShape(std::shared_ptr const &); void AddFBoxStyle(FBoxStyle *); void AddDateFormat(DateCode *); void AddHeaderFooter(HeaderFooter *); @@ -253,8 +253,8 @@ class DLLEXPORT HWPFile void setMaxSettedPage(){ m_nMaxSettedPage = m_nCurrentPage; } private: - int compareCharShape(CharShape *shape); - int compareParaShape(ParaShape *shape); + int compareCharShape(CharShape const *shape); + int compareParaShape(ParaShape const *shape); public: int version; diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 29a884521265..8ac074eff35c 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -3136,7 +3136,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) } -void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) +void HwpReader::makeFieldCode(hchar_string const & rStr, FieldCode const *hbox) { /* Push frame */ if( hbox->type[0] == 4 && hbox->type[1] == 0 ) @@ -3259,7 +3259,7 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) * Completed * In LibreOffice, refer bookmarks as reference, but hwp doesn't have the sort of feature. */ -void HwpReader::makeBookmark(Bookmark * hbox) +void HwpReader::makeBookmark(Bookmark const * hbox) { if (hbox->type == 0) { @@ -4768,7 +4768,7 @@ void HwpReader::makeMailMerge(MailMerge * hbox) } -void HwpReader::makeOutline(Outline * hbox) +void HwpReader::makeOutline(Outline const * hbox) { if( hbox->kind == 1 ) rchars( reinterpret_cast(hbox->GetUnicode().c_str()) ); diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx index 5354b930725b..8acc30879cc0 100644 --- a/hwpfilter/source/hwpreader.hxx +++ b/hwpfilter/source/hwpreader.hxx @@ -116,8 +116,8 @@ private: void makeChars(hchar_string & rStr); /* -------- Special Char Parsing --------- */ - void makeFieldCode(hchar_string & rStr, FieldCode *hbox); //6 - void makeBookmark(Bookmark *hbox); //6 + void makeFieldCode(hchar_string const & rStr, FieldCode const *hbox); //6 + void makeBookmark(Bookmark const *hbox); //6 void makeDateFormat(DateCode *hbox); //7 void makeDateCode(DateCode *hbox); //8 void makeTab(); //9 @@ -133,7 +133,7 @@ private: void makeAutoNum(AutoNum *hbox); void makeShowPageNum(); void makeMailMerge(MailMerge *hbox); - void makeOutline(Outline *hbox); + void makeOutline(Outline const *hbox); /* --------- Styles Parsing ------------ */ void makePageStyle(); -- cgit