summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-11-24 21:43:25 +0100
committerJulien Nabet <serval2412@yahoo.fr>2019-11-24 22:52:21 +0100
commit9d63592d530e9ad5ab2d6aee0aba5bc0c117aae3 (patch)
tree2dd1efe038cd76ec62201873af4287939a1398f8
parentb9448acf3ce4c1c850a691fc33686fd5165b94d9 (diff)
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 <serval2412@yahoo.fr>
-rw-r--r--sc/source/core/data/stlpool.cxx3
-rw-r--r--sc/source/core/tool/detfunc.cxx4
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx2
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx2
-rw-r--r--sc/source/filter/xml/xmldrani.cxx2
-rw-r--r--sc/source/filter/xml/xmlfilti.cxx2
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx5
-rw-r--r--sd/qa/unit/uimpress.cxx2
-rw-r--r--sd/source/filter/eppt/grouptable.hxx10
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx8
-rw-r--r--sd/source/filter/eppt/text.hxx6
-rw-r--r--sd/source/filter/html/htmlex.cxx18
-rw-r--r--sd/source/filter/ppt/propread.cxx3
13 files changed, 31 insertions, 36 deletions
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 ];
}