sc/source/core/data/stlpool.cxx                     |    3 +--
 sc/source/core/tool/detfunc.cxx                     |    4 ++--
 sc/source/filter/oox/worksheethelper.cxx            |    2 +-
 sc/source/filter/xml/xmlcoli.cxx                    |    2 +-
 sc/source/filter/xml/xmldrani.cxx                   |    2 +-
 sc/source/filter/xml/xmlfilti.cxx                   |    2 +-
 scripting/source/provider/BrowseNodeFactoryImpl.cxx |    5 ++---
 sd/qa/unit/uimpress.cxx                             |    2 +-
 sd/source/filter/eppt/grouptable.hxx                |   10 +++++-----
 sd/source/filter/eppt/pptx-text.cxx                 |    8 ++++----
 sd/source/filter/eppt/text.hxx                      |    6 +++---
 sd/source/filter/html/htmlex.cxx                    |   18 ++++++++----------
 sd/source/filter/ppt/propread.cxx                   |    3 +--
 13 files changed, 31 insertions(+), 36 deletions(-)

New commits:
commit 9d63592d530e9ad5ab2d6aee0aba5bc0c117aae3
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Nov 24 21:43:25 2019 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun Nov 24 22:52:21 2019 +0100

    cppcheck: performing init in init list (sc/scripting/sd)
    
    Change-Id: I8bd4c1b7b551a96ecd5a2b50fbfdf225567175f6
    Reviewed-on: https://gerrit.libreoffice.org/83621
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 2a701c1b26e8..897dc19891d5 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -380,9 +380,8 @@ namespace {
 struct CaseInsensitiveNamePredicate : svl::StyleSheetPredicate
 {
     CaseInsensitiveNamePredicate(const OUString& rName, SfxStyleFamily eFam)
-    : mFamily(eFam)
+    : mUppercaseName(ScGlobal::pCharClass->uppercase(rName)), mFamily(eFam)
     {
-        mUppercaseName = ScGlobal::pCharClass->uppercase(rName);
     }
 
     bool
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index b253e6c4bbbb..91693af8ff40 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -147,9 +147,9 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
     aArrowSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} 
),
     aToTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} 
),
     aFromTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, 
SDRATTR_END>{} ),
-    aCircleSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, 
SDRATTR_END>{} )
+    aCircleSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, 
SDRATTR_END>{} ),
+    nMaxLevel(0)
 {
-    nMaxLevel = 0;
 
     aBoxSet.Put( XLineColorItem( EMPTY_OUSTRING, 
ScDetectiveFunc::GetArrowColor() ) );
     aBoxSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index a567435fcc28..3fb3693b7e6a 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -407,9 +407,9 @@ WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& 
rHelper, const ISegmen
     mxProgressBar( rxProgressBar ),
     mbFastRowProgress( false ),
     meSheetType( eSheetType ),
+    mxSheet(getSheetFromDoc( nSheet )),
     mbHasDefWidth( false )
 {
-    mxSheet = getSheetFromDoc( nSheet );
     if( !mxSheet.is() )
         maUsedArea.aStart.SetTab( -1 );
 
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 1d4d0966d707..40f8b4f74d56 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -40,9 +40,9 @@ using namespace xmloff::token;
 ScXMLTableColContext::ScXMLTableColContext( ScXMLImport& rImport,
                                       const 
rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList ) :
     ScXMLImportContext( rImport ),
+    nColCount(1),
     sVisibility(GetXMLToken(XML_VISIBLE))
 {
-    nColCount = 1;
     if ( rAttrList.is() )
     {
         for (auto &aIter : *rAttrList)
diff --git a/sc/source/filter/xml/xmldrani.cxx 
b/sc/source/filter/xml/xmldrani.cxx
index 5a6e362677d8..5ca1a1c01b08 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -87,6 +87,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport& rImport,
     mpQueryParam(new ScQueryParam),
     sDatabaseRangeName(STR_DB_LOCAL_NONAME),
     aSortSequence(),
+    nSourceType(sheet::DataImportMode_NONE),
     nRefresh(0),
     nSubTotalsUserListIndex(0),
     mbValidRange(true),
@@ -109,7 +110,6 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport& rImport,
     bByRow(false),
     meRangeType(ScDBCollection::GlobalNamed)
 {
-    nSourceType = sheet::DataImportMode_NONE;
     if( rAttrList.is() )
     {
         for( auto &aIter : *rAttrList )
diff --git a/sc/source/filter/xml/xmlfilti.cxx 
b/sc/source/filter/xml/xmlfilti.cxx
index 47fea817123c..50cfb09bfb8e 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -290,10 +290,10 @@ ScXMLConditionContext::ScXMLConditionContext(
     ScXMLImportContext( rImport ),
     mrQueryParam(rParam),
     pFilterContext(pTempFilterContext),
+    sDataType(GetXMLToken(XML_TEXT)),
     nField(0),
     bIsCaseSensitive(false)
 {
-    sDataType = GetXMLToken(XML_TEXT);
 
     if ( rAttrList.is() )
     {
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx 
b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index b544fd328a56..a4d91f776d40 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -65,8 +65,8 @@ private:
 public:
 
     explicit BrowseNodeAggregator( const Reference< browse::XBrowseNode >& 
node )
+        : m_Name(node->getName())
     {
-        m_Name = node->getName();
         m_Nodes.resize( 1 );
         m_Nodes[ 0 ] = node;
     }
@@ -166,9 +166,8 @@ private:
 public:
 
     explicit LocationBrowseNode( const Reference< browse::XBrowseNode >& node )
+        : m_sNodeName(node->getName())
     {
-        m_sNodeName = node->getName();
-        m_hBNA = nullptr;
         m_origNode.set( node );
     }
 
diff --git a/sd/qa/unit/uimpress.cxx b/sd/qa/unit/uimpress.cxx
index 74678dc7d920..cd9a98296ad2 100644
--- a/sd/qa/unit/uimpress.cxx
+++ b/sd/qa/unit/uimpress.cxx
@@ -50,8 +50,8 @@ private:
 };
 
 Test::Test()
+    : m_xContext(cppu::defaultBootstrap_InitialComponentContext())
 {
-    m_xContext = cppu::defaultBootstrap_InitialComponentContext();
 
     uno::Reference<lang::XMultiComponentFactory> 
xFactory(m_xContext->getServiceManager());
     uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, 
uno::UNO_QUERY_THROW);
diff --git a/sd/source/filter/eppt/grouptable.hxx 
b/sd/source/filter/eppt/grouptable.hxx
index d792072479cb..a88201e195ee 100644
--- a/sd/source/filter/eppt/grouptable.hxx
+++ b/sd/source/filter/eppt/grouptable.hxx
@@ -31,16 +31,16 @@ struct GroupEntry
     css::uno::Reference< css::container::XIndexAccess >           
mXIndexAccess;
 
     explicit GroupEntry( css::uno::Reference< css::container::XIndexAccess > 
const & rIndex )
+      : mnCurrentPos(0),
+        mnCount(mXIndexAccess->getCount()),
+        mXIndexAccess(rIndex)
     {
-        mXIndexAccess = rIndex;
-        mnCount =mXIndexAccess->getCount();
-        mnCurrentPos = 0;
     };
 
     explicit GroupEntry( sal_uInt32 nCount )
+      :  mnCurrentPos(0),
+         mnCount(nCount)
     {
-        mnCount = nCount;
-        mnCurrentPos = 0;
     };
 };
 
diff --git a/sd/source/filter/eppt/pptx-text.cxx 
b/sd/source/filter/eppt/pptx-text.cxx
index f3b3393c32d8..10ed9d3b69eb 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1260,11 +1260,11 @@ struct ImplTextObj
 };
 
 ImplTextObj::ImplTextObj( int nInstance )
-  : maList()
+  : mnTextSize(0),
+    mnInstance(nInstance),
+    maList(),
+    mbHasExtendedBullets(false)
 {
-    mnTextSize = 0;
-    mnInstance = nInstance;
-    mbHasExtendedBullets = false;
 }
 
 TextObj::TextObj( css::uno::Reference< css::text::XSimpleText > const & 
rXTextRef,
diff --git a/sd/source/filter/eppt/text.hxx b/sd/source/filter/eppt/text.hxx
index 4f32412d35e3..4b9c85d9c9fd 100644
--- a/sd/source/filter/eppt/text.hxx
+++ b/sd/source/filter/eppt/text.hxx
@@ -105,10 +105,10 @@ struct FieldEntry
     OUString    aFieldUrl;
 
     FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
+      : nFieldType(nType),
+        nFieldStartPos(nStart),
+        nFieldEndPos(nEnd)
     {
-        nFieldType = nType;
-        nFieldStartPos = nStart;
-        nFieldEndPos = nEnd;
     }
 };
 
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 77189e3d543d..b140e930749f 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -177,14 +177,14 @@ OUString HtmlState::Flush()
 
 // c'tor with default color for the page
 HtmlState::HtmlState( Color aDefColor )
+  : mbColor(false),
+    mbWeight(false),
+    mbItalic(false),
+    mbUnderline(false),
+    mbStrike(false),
+    mbLink(false),
+    maDefColor(aDefColor)
 {
-    mbColor = false;
-    mbWeight = false;
-    mbItalic = false;
-    mbUnderline = false;
-    mbLink = false;
-    mbStrike = false;
-    maDefColor = aDefColor;
 }
 
 // enables/disables bold print
@@ -3097,10 +3097,8 @@ OUString HtmlExport::GetButtonName( int nButton )
     return OUString::createFromAscii(pButtonNames[nButton]);
 }
 
-EasyFile::EasyFile()
+EasyFile::EasyFile() : bOpen(false)
 {
-    pOStm = nullptr;
-    bOpen = false;
 }
 
 EasyFile::~EasyFile()
diff --git a/sd/source/filter/ppt/propread.cxx 
b/sd/source/filter/ppt/propread.cxx
index 71472b2f9515..ab80510d07b8 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -208,9 +208,8 @@ Section::Section( const Section& rSection )
         maEntries.push_back(std::make_unique<PropEntry>(*rEntry));
 }
 
-Section::Section( const sal_uInt8* pFMTID )
+Section::Section( const sal_uInt8* pFMTID ) : 
mnTextEnc(RTL_TEXTENCODING_MS_1252)
 {
-    mnTextEnc = RTL_TEXTENCODING_MS_1252;
     for ( int i = 0; i < 16; i++ )
         aFMTID[ i ] = pFMTID[ i ];
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to