Kaydet (Commit) 3ccaa4d9 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constparams in scaddins,hwpfilter

Change-Id: I91b3559b9c3f5d8837d182cf9406fad9aeee78b3
Reviewed-on: https://gerrit.libreoffice.org/40049Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 871f1f72
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "hbox.h" #include "hbox.h"
#include "hutil.h" #include "hutil.h"
void LineInfo::Read(HWPFile & hwpf, HWPPara *pPara) void LineInfo::Read(HWPFile & hwpf, HWPPara const *pPara)
{ {
if (!hwpf.Read2b(pos)) if (!hwpf.Read2b(pos))
return; return;
......
...@@ -69,7 +69,7 @@ struct LineInfo ...@@ -69,7 +69,7 @@ struct LineInfo
hunit height_sp; hunit height_sp;
unsigned short softbreak; // column, page, section unsigned short softbreak; // column, page, section
void Read(HWPFile &hwpf, HWPPara *para); void Read(HWPFile &hwpf, HWPPara const *para);
}; };
/** /**
* It represents the paragraph. * It represents the paragraph.
......
...@@ -61,7 +61,7 @@ char *HWPStyle::GetName(int n) const ...@@ -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) if (n >= 0 && n < nstyles)
{ {
...@@ -81,7 +81,7 @@ CharShape *HWPStyle::GetCharShape(int n) const ...@@ -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) if (n >= 0 && n < nstyles)
{ {
...@@ -101,7 +101,7 @@ ParaShape *HWPStyle::GetParaShape(int n) const ...@@ -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) if (n >= 0 && n < nstyles)
{ {
......
...@@ -41,9 +41,9 @@ class DLLEXPORT HWPStyle ...@@ -41,9 +41,9 @@ class DLLEXPORT HWPStyle
CharShape *GetCharShape( int n ) const; CharShape *GetCharShape( int n ) const;
ParaShape *GetParaShape( int n ) const; ParaShape *GetParaShape( int n ) const;
void SetName( int n, char *name ); void SetName( int n, char const *name );
void SetCharShape( int n, CharShape *cshapep ); void SetCharShape( int n, CharShape const *cshapep );
void SetParaShape( int n, ParaShape *pshapep ); void SetParaShape( int n, ParaShape const *pshapep );
void Read( HWPFile &hwpf ); void Read( HWPFile &hwpf );
}; };
......
...@@ -388,7 +388,7 @@ static const hwpeq eq_tbl[] = { ...@@ -388,7 +388,7 @@ static const hwpeq eq_tbl[] = {
{ "zeta", nullptr, 0, EQ_CASE } { "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); static const int eqCount = SAL_N_ELEMENTS(eq_tbl);
int l = 0, r = eqCount; int l = 0, r = eqCount;
...@@ -459,7 +459,7 @@ struct eq_stack { ...@@ -459,7 +459,7 @@ struct eq_stack {
istream *strm; istream *strm;
eq_stack() { strm = nullptr; }; eq_stack() { strm = nullptr; };
bool state(istream *s) { bool state(istream const *s) {
if( strm != s) { white = nullptr; token = nullptr; } if( strm != s) { white = nullptr; token = nullptr; }
return token.length() != 0; return token.length() != 0;
} }
...@@ -467,7 +467,7 @@ struct eq_stack { ...@@ -467,7 +467,7 @@ struct eq_stack {
static eq_stack *stk = nullptr; 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 // one time stack
assert(stk->token.length() == 0); assert(stk->token.length() == 0);
...@@ -749,7 +749,7 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel) ...@@ -749,7 +749,7 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
return token[0]; return token[0];
} }
void eq2latex(MzString& outs, char *s) void eq2latex(MzString& outs, char const *s)
{ {
assert(s); assert(s);
if( stk == nullptr ) if( stk == nullptr )
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "mzstring.h" #include "mzstring.h"
void eq2latex(MzString &mstr, char *str); void eq2latex(MzString &mstr, char const *str);
#endif // INCLUDED_HWPFILTER_SOURCE_HWPEQ_H #endif // INCLUDED_HWPFILTER_SOURCE_HWPEQ_H
......
...@@ -520,7 +520,7 @@ Table *HWPFile::getTable(int index) ...@@ -520,7 +520,7 @@ Table *HWPFile::getTable(int index)
return tables[index]; return tables[index];
} }
void HWPFile::AddParaShape(std::shared_ptr<ParaShape>& pshape) void HWPFile::AddParaShape(std::shared_ptr<ParaShape> const & pshape)
{ {
int nscount = 0; int nscount = 0;
for(int j = 0 ; j < MAXTABS-1 ; j++) for(int j = 0 ; j < MAXTABS-1 ; j++)
...@@ -552,7 +552,7 @@ void HWPFile::AddParaShape(std::shared_ptr<ParaShape>& pshape) ...@@ -552,7 +552,7 @@ void HWPFile::AddParaShape(std::shared_ptr<ParaShape>& pshape)
pshape->index = value; pshape->index = value;
} }
void HWPFile::AddCharShape(std::shared_ptr<CharShape>& cshape) void HWPFile::AddCharShape(std::shared_ptr<CharShape> const & cshape)
{ {
int value = compareCharShape(cshape.get()); int value = compareCharShape(cshape.get());
if (value == 0) if (value == 0)
...@@ -606,7 +606,7 @@ void HWPFile::AddFBoxStyle(FBoxStyle * fbstyle) ...@@ -606,7 +606,7 @@ void HWPFile::AddFBoxStyle(FBoxStyle * fbstyle)
fbslist.push_back(fbstyle); fbslist.push_back(fbstyle);
} }
int HWPFile::compareCharShape(CharShape *shape) int HWPFile::compareCharShape(CharShape const *shape)
{ {
int count = cslist.size(); int count = cslist.size();
if( count > 0 ) if( count > 0 )
...@@ -632,7 +632,7 @@ int HWPFile::compareCharShape(CharShape *shape) ...@@ -632,7 +632,7 @@ int HWPFile::compareCharShape(CharShape *shape)
} }
int HWPFile::compareParaShape(ParaShape *shape) int HWPFile::compareParaShape(ParaShape const *shape)
{ {
int count = pslist.size(); int count = pslist.size();
if( count > 0 ) if( count > 0 )
......
...@@ -212,8 +212,8 @@ class DLLEXPORT HWPFile ...@@ -212,8 +212,8 @@ class DLLEXPORT HWPFile
void AddPage(){ m_nCurrentPage++;} void AddPage(){ m_nCurrentPage++;}
void AddColumnInfo(); void AddColumnInfo();
void SetColumnDef(ColumnDef *coldef); void SetColumnDef(ColumnDef *coldef);
void AddParaShape(std::shared_ptr<ParaShape>&); void AddParaShape(std::shared_ptr<ParaShape> const &);
void AddCharShape(std::shared_ptr<CharShape>&); void AddCharShape(std::shared_ptr<CharShape> const &);
void AddFBoxStyle(FBoxStyle *); void AddFBoxStyle(FBoxStyle *);
void AddDateFormat(DateCode *); void AddDateFormat(DateCode *);
void AddHeaderFooter(HeaderFooter *); void AddHeaderFooter(HeaderFooter *);
...@@ -253,8 +253,8 @@ class DLLEXPORT HWPFile ...@@ -253,8 +253,8 @@ class DLLEXPORT HWPFile
void setMaxSettedPage(){ m_nMaxSettedPage = m_nCurrentPage; } void setMaxSettedPage(){ m_nMaxSettedPage = m_nCurrentPage; }
private: private:
int compareCharShape(CharShape *shape); int compareCharShape(CharShape const *shape);
int compareParaShape(ParaShape *shape); int compareParaShape(ParaShape const *shape);
public: public:
int version; int version;
......
...@@ -3136,7 +3136,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) ...@@ -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 */ /* Push frame */
if( hbox->type[0] == 4 && hbox->type[1] == 0 ) if( hbox->type[0] == 4 && hbox->type[1] == 0 )
...@@ -3259,7 +3259,7 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox) ...@@ -3259,7 +3259,7 @@ void HwpReader::makeFieldCode(hchar_string & rStr, FieldCode *hbox)
* Completed * Completed
* In LibreOffice, refer bookmarks as reference, but hwp doesn't have the sort of feature. * 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) if (hbox->type == 0)
{ {
...@@ -4768,7 +4768,7 @@ void HwpReader::makeMailMerge(MailMerge * hbox) ...@@ -4768,7 +4768,7 @@ void HwpReader::makeMailMerge(MailMerge * hbox)
} }
void HwpReader::makeOutline(Outline * hbox) void HwpReader::makeOutline(Outline const * hbox)
{ {
if( hbox->kind == 1 ) if( hbox->kind == 1 )
rchars( reinterpret_cast<sal_Unicode const *>(hbox->GetUnicode().c_str()) ); rchars( reinterpret_cast<sal_Unicode const *>(hbox->GetUnicode().c_str()) );
......
...@@ -116,8 +116,8 @@ private: ...@@ -116,8 +116,8 @@ private:
void makeChars(hchar_string & rStr); void makeChars(hchar_string & rStr);
/* -------- Special Char Parsing --------- */ /* -------- Special Char Parsing --------- */
void makeFieldCode(hchar_string & rStr, FieldCode *hbox); //6 void makeFieldCode(hchar_string const & rStr, FieldCode const *hbox); //6
void makeBookmark(Bookmark *hbox); //6 void makeBookmark(Bookmark const *hbox); //6
void makeDateFormat(DateCode *hbox); //7 void makeDateFormat(DateCode *hbox); //7
void makeDateCode(DateCode *hbox); //8 void makeDateCode(DateCode *hbox); //8
void makeTab(); //9 void makeTab(); //9
...@@ -133,7 +133,7 @@ private: ...@@ -133,7 +133,7 @@ private:
void makeAutoNum(AutoNum *hbox); void makeAutoNum(AutoNum *hbox);
void makeShowPageNum(); void makeShowPageNum();
void makeMailMerge(MailMerge *hbox); void makeMailMerge(MailMerge *hbox);
void makeOutline(Outline *hbox); void makeOutline(Outline const *hbox);
/* --------- Styles Parsing ------------ */ /* --------- Styles Parsing ------------ */
void makePageStyle(); void makePageStyle();
......
...@@ -254,7 +254,7 @@ struct FindFuncData ...@@ -254,7 +254,7 @@ struct FindFuncData
{ {
const OUString& m_rId; const OUString& m_rId;
explicit FindFuncData( const OUString& rId ) : m_rId(rId) {} explicit FindFuncData( const OUString& rId ) : m_rId(rId) {}
bool operator() ( FuncData& rCandidate ) const { return rCandidate.Is(m_rId); } bool operator() ( FuncData const & rCandidate ) const { return rCandidate.Is(m_rId); }
}; };
class AnalysisResId : public ResId class AnalysisResId : public ResId
......
...@@ -99,7 +99,7 @@ struct FindScaFuncData ...@@ -99,7 +99,7 @@ struct FindScaFuncData
{ {
const OUString& m_rId; const OUString& m_rId;
explicit FindScaFuncData( const OUString& rId ) : m_rId(rId) {} explicit FindScaFuncData( const OUString& rId ) : m_rId(rId) {}
bool operator() ( ScaFuncData& rCandidate ) const { return rCandidate.Is(m_rId); } bool operator() ( ScaFuncData const & rCandidate ) const { return rCandidate.Is(m_rId); }
}; };
......
...@@ -117,7 +117,7 @@ struct FindScaFuncData ...@@ -117,7 +117,7 @@ struct FindScaFuncData
{ {
const OUString& m_rId; const OUString& m_rId;
explicit FindScaFuncData( const OUString& rId ) : m_rId(rId) {} explicit FindScaFuncData( const OUString& rId ) : m_rId(rId) {}
bool operator() ( ScaFuncData& rCandidate ) const { return rCandidate.Is(m_rId); } bool operator() ( ScaFuncData const & rCandidate ) const { return rCandidate.Is(m_rId); }
}; };
} // namespace pricing } // namespace pricing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment