From d2c9e289733df395b911a46c1028014f42e75f99 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 24 Nov 2019 20:26:22 +0100 Subject: cppcheck: performing init in init list (hwpfilter, i., l.) Change-Id: Idf5b7be45d48076fbe191fbf1a2fa63c6da71902 Reviewed-on: https://gerrit.libreoffice.org/83617 Tested-by: Jenkins Reviewed-by: Julien Nabet --- lotuswordpro/source/filter/bento.hxx | 6 +++--- lotuswordpro/source/filter/lwpbackgroundstuff.hxx | 3 +-- lotuswordpro/source/filter/lwpborderstuff.cxx | 24 +++++++++------------- lotuswordpro/source/filter/lwpframelayout.cxx | 4 +--- lotuswordpro/source/filter/lwpgrfobj.hxx | 12 +++++------ lotuswordpro/source/filter/lwplaypiece.cxx | 10 ++++----- .../source/filter/lwpnumberingoverride.cxx | 3 +-- lotuswordpro/source/filter/lwpnumericfmt.hxx | 12 +++-------- lotuswordpro/source/filter/lwptabrack.cxx | 15 +++++++------- lotuswordpro/source/filter/lwptblcell.hxx | 3 +-- lotuswordpro/source/filter/lwptblformula.cxx | 15 +++++--------- lotuswordpro/source/filter/lwptoc.cxx | 5 ++--- lotuswordpro/source/filter/utbenvs.cxx | 8 ++++---- .../source/filter/xfilter/xfsaxattrlist.cxx | 3 +-- 14 files changed, 51 insertions(+), 72 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index 9f9447f4d7c1..b15cb6bc371f 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -142,9 +142,9 @@ sal_uLong BenOpenContainer(LwpSvStream * pStream, std::unique_ptr LwpBorderStuff::LwpBorderStuff() + : m_nSides(0), m_nValid(0), + m_nBorderGroupIDLeft(0), + m_nBorderGroupIDRight(0), + m_nBorderGroupIDTop(0), + m_nBorderGroupIDBottom(0), + m_nGroupIndent(0), + m_nWidthLeft(0), + m_nWidthTop(0), + m_nWidthRight(0), + m_nWidthBottom(0) { - m_nSides = 0; - m_nValid = 0; - - m_nBorderGroupIDLeft = 0; - m_nBorderGroupIDRight = 0; - m_nBorderGroupIDTop = 0; - m_nBorderGroupIDBottom = 0; - - m_nGroupIndent = 0; - - m_nWidthLeft = 0; - m_nWidthTop = 0; - m_nWidthRight = 0; - m_nWidthBottom = 0; } void LwpBorderStuff::Read(LwpObjectStream *pStrm) diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx index 3e6d9580f4e6..6f7a77e77b5f 100644 --- a/lotuswordpro/source/filter/lwpframelayout.cxx +++ b/lotuswordpro/source/filter/lwpframelayout.cxx @@ -1133,10 +1133,8 @@ void LwpGroupFrame::XFConvert(XFContentContainer* /*pCont*/) } LwpDropcapLayout::LwpDropcapLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) - : LwpFrameLayout(objHdr, pStrm) + : LwpFrameLayout(objHdr, pStrm), m_nLines(3), m_nChars(1) { - m_nChars = 1; - m_nLines = 3; } void LwpDropcapLayout::Read() diff --git a/lotuswordpro/source/filter/lwpgrfobj.hxx b/lotuswordpro/source/filter/lwpgrfobj.hxx index 0c26f1c6e062..988d338e9613 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.hxx +++ b/lotuswordpro/source/filter/lwpgrfobj.hxx @@ -77,13 +77,13 @@ struct ImageProcessingData bool bInvertImage; ImageProcessingData() + : nBrightness(50), + nContrast(50), + nEdgeEnchancement(0), + nSmoothing(0), + bAutoContrast(false), + bInvertImage(false) { - nBrightness = 50; - nContrast = 50; - nEdgeEnchancement = 0; - nSmoothing = 0; - bAutoContrast = false; - bInvertImage= false; } }; diff --git a/lotuswordpro/source/filter/lwplaypiece.cxx b/lotuswordpro/source/filter/lwplaypiece.cxx index c4519fc27592..1922e1543a6e 100644 --- a/lotuswordpro/source/filter/lwplaypiece.cxx +++ b/lotuswordpro/source/filter/lwplaypiece.cxx @@ -394,14 +394,14 @@ void LwpLayoutShadow::Parse(IXFStream* /*pOutputStream*/) {} LwpLayoutRelativityGuts::LwpLayoutRelativityGuts() + : m_nRelType(LAY_PARENT_RELATIVE), + m_nRelFromWhere(LAY_UPPERLEFT), + m_nTether(LAY_UPPERLEFT), + m_nTetherWhere(LAY_BORDER), + m_nFlags(0) { - m_nRelType = LAY_PARENT_RELATIVE; - m_nRelFromWhere = LAY_UPPERLEFT; m_RelDistance.SetX(0); m_RelDistance.SetY(0); - m_nTether = LAY_UPPERLEFT; - m_nTetherWhere = LAY_BORDER; - m_nFlags = 0; } /************************************************************************** * @descr: Read LayoutRelativityGuts' information. diff --git a/lotuswordpro/source/filter/lwpnumberingoverride.cxx b/lotuswordpro/source/filter/lwpnumberingoverride.cxx index ae8de9dc9833..e04851bfd7be 100644 --- a/lotuswordpro/source/filter/lwpnumberingoverride.cxx +++ b/lotuswordpro/source/filter/lwpnumberingoverride.cxx @@ -62,9 +62,8 @@ #include LwpNumberingOverride::LwpNumberingOverride() + : m_nLevel(0), m_nPosition(0) { - m_nLevel = 0; - m_nPosition = 0; } LwpNumberingOverride::LwpNumberingOverride(LwpNumberingOverride const& rOther) diff --git a/lotuswordpro/source/filter/lwpnumericfmt.hxx b/lotuswordpro/source/filter/lwpnumericfmt.hxx index bd21accecfe8..783ac8a71d46 100644 --- a/lotuswordpro/source/filter/lwpnumericfmt.hxx +++ b/lotuswordpro/source/filter/lwpnumericfmt.hxx @@ -102,21 +102,15 @@ struct LwpCurrencyInfo bool bPost; bool bShowSpace; explicit LwpCurrencyInfo(const OUString& sSym) + : sSymbol(sSym), bPost(false), bShowSpace(false) { - sSymbol = sSym; - bPost = false; - bShowSpace = false; } - LwpCurrencyInfo() + LwpCurrencyInfo() : bPost(false), bShowSpace(false) { - bPost = false; - bShowSpace = false; } LwpCurrencyInfo(const OUString& sSym, bool bPost_, bool bShowSpace_) + : sSymbol(sSym), bPost(bPost_), bShowSpace(bShowSpace_) { - sSymbol = sSym; - bPost = bPost_; - bShowSpace = bShowSpace_; } }; diff --git a/lotuswordpro/source/filter/lwptabrack.cxx b/lotuswordpro/source/filter/lwptabrack.cxx index 5f852707a91d..84a80decd93b 100644 --- a/lotuswordpro/source/filter/lwptabrack.cxx +++ b/lotuswordpro/source/filter/lwptabrack.cxx @@ -63,12 +63,12 @@ #include LwpTab::LwpTab() + : m_nX(0), + m_nType(0), + m_nLeader(0), + m_nRelativeType(0), + m_nAlignChar(0) //be careful,not quite sure it's 8-bit,perhaps 16-bit. { - m_nX = 0; - m_nAlignChar = 0; //be careful,not quite sure it's 8-bit,perhaps 16-bit. - m_nType = 0; - m_nLeader = 0; - m_nRelativeType = 0; } void LwpTab::Read(LwpObjectStream *pStrm) @@ -80,9 +80,10 @@ void LwpTab::Read(LwpObjectStream *pStrm) m_nAlignChar = pStrm->QuickReaduInt16(); } -LwpTabRack::LwpTabRack(LwpObjectHeader objHdr, LwpSvStream* pStrm):LwpObject(objHdr,pStrm) +LwpTabRack::LwpTabRack(LwpObjectHeader objHdr, LwpSvStream* pStrm) + : LwpObject(objHdr,pStrm), + m_nNumTabs(0) { - m_nNumTabs = 0; } void LwpTabRack::Read() diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx index 4303cc9c05b6..7505b7cf549b 100644 --- a/lotuswordpro/source/filter/lwptblcell.hxx +++ b/lotuswordpro/source/filter/lwptblcell.hxx @@ -246,9 +246,8 @@ private: }; inline -LwpRowColumnQualifier::LwpRowColumnQualifier() +LwpRowColumnQualifier::LwpRowColumnQualifier() : cFlags(0) { - cFlags = 0; } inline bool diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx index f79bcaab6bcb..1a0b47822bbb 100644 --- a/lotuswordpro/source/filter/lwptblformula.cxx +++ b/lotuswordpro/source/filter/lwptblformula.cxx @@ -357,15 +357,13 @@ OUString LwpFormulaConst::ToString(LwpTableLayout* /*pCellsMap*/) return OUString::number(m_dVal); } -LwpFormulaText::LwpFormulaText( const OUString& aText) +LwpFormulaText::LwpFormulaText( const OUString& aText) : m_aText(aText) { - m_aText = aText; } LwpFormulaCellAddr::LwpFormulaCellAddr(sal_Int16 aCol, sal_Int16 aRow) + : m_aCol(aCol), m_aRow(aRow) { - m_aCol = aCol; - m_aRow = aRow; } OUString LwpFormulaCellAddr::ToString(LwpTableLayout* pCellsMap) @@ -378,11 +376,9 @@ LwpFormulaCellRangeAddr::LwpFormulaCellRangeAddr(sal_Int16 aStartCol, sal_Int16 aStartRow, sal_Int16 aEndCol, sal_Int16 aEndRow) + : m_aStartCol(aStartCol), m_aStartRow(aStartRow), + m_aEndCol(aEndCol), m_aEndRow(aEndRow) { - m_aStartCol = aStartCol; - m_aStartRow = aStartRow; - m_aEndCol = aEndCol; - m_aEndRow = aEndRow; } /** @@ -397,9 +393,8 @@ OUString LwpFormulaCellRangeAddr::ToString(LwpTableLayout* pCellsMap) return aCellAddr; } -LwpFormulaFunc::LwpFormulaFunc(sal_uInt16 nTokenType) +LwpFormulaFunc::LwpFormulaFunc(sal_uInt16 nTokenType) : m_nTokenType(nTokenType) { - m_nTokenType = nTokenType; } LwpFormulaFunc::~LwpFormulaFunc() diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index 89ab770e4726..4d429ddb258c 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -434,10 +434,9 @@ LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, Lwp return nullptr; } -LwpTocLevelData::LwpTocLevelData(LwpObjectHeader const &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm) +LwpTocLevelData::LwpTocLevelData(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) + : LwpDLVList(objHdr, pStrm), m_nFlags(0), m_nLevel(0) { - m_nFlags = 0; - m_nLevel = 0; } LwpTocLevelData::~LwpTocLevelData() { diff --git a/lotuswordpro/source/filter/utbenvs.cxx b/lotuswordpro/source/filter/utbenvs.cxx index dc508c168664..f597351aee85 100644 --- a/lotuswordpro/source/filter/utbenvs.cxx +++ b/lotuswordpro/source/filter/utbenvs.cxx @@ -124,11 +124,11 @@ void LtcUtBenValueStream::FlushData() * Construction */ LtcUtBenValueStream::LtcUtBenValueStream(CBenValue * pValue) -{ + : cpValue(pValue), // Calculate the length of the whole value stream - cCurrentPosition = 0; - m_ulValueLength = pValue->GetValueSize(); - cpValue = pValue; + cCurrentPosition(0), + m_ulValueLength(pValue->GetValueSize()) +{ } LtcUtBenValueStream::~LtcUtBenValueStream() diff --git a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx index ffd36284f8c4..5bd78fb82190 100644 --- a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx +++ b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx @@ -60,9 +60,8 @@ #include "xfsaxattrlist.hxx" #include -XFSaxAttrList::XFSaxAttrList() +XFSaxAttrList::XFSaxAttrList() : m_xSvAttrList(new SvXMLAttributeList()) { - m_xSvAttrList = new SvXMLAttributeList(); } XFSaxAttrList::~XFSaxAttrList() -- cgit