summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-11-23 20:25:07 +0100
committerJulien Nabet <serval2412@yahoo.fr>2019-11-23 23:51:35 +0100
commit4e1ae2a9a0d2d9185b49677fa4ea2a2b1fe8bab2 (patch)
tree0337a97264ee26ac753ebf66b15f45555e2e0e0d /connectivity
parente6ab01ce532d1db01579b70bd476b2f643522bf9 (diff)
cppcheck: performing init in init list (comphelper/connectivity/cppu/cui)
Change-Id: I786c2c10e8b37b48adf6d619c0fa6a905de1bf7f Reviewed-on: https://gerrit.libreoffice.org/83584 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/hsqldb/accesslog.cxx4
-rw-r--r--connectivity/source/drivers/macab/MacabAddressBook.cxx6
-rw-r--r--connectivity/source/drivers/macab/MacabRecord.cxx5
-rw-r--r--connectivity/source/drivers/macab/MacabRecords.cxx38
-rw-r--r--connectivity/source/drivers/macab/MacabResultSet.cxx4
-rw-r--r--connectivity/source/drivers/mork/MStatement.cxx4
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx2
7 files changed, 20 insertions, 43 deletions
diff --git a/connectivity/source/drivers/hsqldb/accesslog.cxx b/connectivity/source/drivers/hsqldb/accesslog.cxx
index 880600a71d5a..bc5a2c3de81e 100644
--- a/connectivity/source/drivers/hsqldb/accesslog.cxx
+++ b/connectivity/source/drivers/hsqldb/accesslog.cxx
@@ -39,9 +39,9 @@ namespace connectivity { namespace hsqldb
LogFile::LogFile( JNIEnv* env, jstring streamName, const sal_Char* _pAsciiSuffix )
+ : m_sFileName(StorageContainer::jstring2ustring(env,streamName) +
+ "." + OUString::createFromAscii( _pAsciiSuffix ) )
{
- m_sFileName = StorageContainer::jstring2ustring(env,streamName) +
- "." + OUString::createFromAscii( _pAsciiSuffix );
}
diff --git a/connectivity/source/drivers/macab/MacabAddressBook.cxx b/connectivity/source/drivers/macab/MacabAddressBook.cxx
index 46570ef5ff57..09e4892033e8 100644
--- a/connectivity/source/drivers/macab/MacabAddressBook.cxx
+++ b/connectivity/source/drivers/macab/MacabAddressBook.cxx
@@ -78,10 +78,10 @@ void manageDuplicateGroups(std::vector<MacabGroup *> _xGroups)
}
MacabAddressBook::MacabAddressBook( )
+ : m_aAddressBook(ABGetSharedAddressBook()),
+ m_xMacabRecords(nullptr),
+ m_bRetrievedGroups(false)
{
- m_aAddressBook = ABGetSharedAddressBook();
- m_xMacabRecords = nullptr;
- m_bRetrievedGroups = false;
}
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
index 5d95e320ef20..b7e270f378f2 100644
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ b/connectivity/source/drivers/macab/MacabRecord.cxx
@@ -33,13 +33,14 @@ using namespace com::sun::star::util;
using namespace ::dbtools;
-MacabRecord::MacabRecord()
+MacabRecord::MacabRecord() : size(0)
{
- size = 0;
}
MacabRecord::MacabRecord(const sal_Int32 _size)
+ : size(_size),
+ fields(std::make_unique<macabfield *[]>(size))
{
size = _size;
fields = std::make_unique<macabfield *[]>(size);
diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx
index 4b7220e56723..0bc27ea0ee6f 100644
--- a/connectivity/source/drivers/macab/MacabRecords.cxx
+++ b/connectivity/source/drivers/macab/MacabRecords.cxx
@@ -73,17 +73,9 @@ void manageDuplicateHeaders(macabfield **_headerNames, const sal_Int32 _length)
}
MacabRecords::MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords)
+ : recordsSize(_numRecords), currentRecord(_numRecords), recordType(kABPersonRecordType),
+ header(_header), records(_records), addressBook(_addressBook)
{
- /* Variables passed in... */
- header = _header;
- recordsSize = _numRecords;
- currentRecord = _numRecords;
- records = _records;
- addressBook = _addressBook;
-
- /* Default variables... */
- recordType = kABPersonRecordType;
-
/* Variables constructed... */
bootstrap_CF_types();
bootstrap_requiredProperties();
@@ -99,18 +91,10 @@ MacabRecords::MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_he
* header.
*/
MacabRecords::MacabRecords(const MacabRecords *_copy)
+ : recordsSize(_copy->recordsSize), currentRecord(0), recordType(kABPersonRecordType),
+ header(nullptr), records(new MacabRecord *[recordsSize]), addressBook(_copy->addressBook),
+ m_sName(_copy->m_sName)
{
- /* Variables passed in... */
- recordsSize = _copy->recordsSize;
- addressBook = _copy->addressBook;
- m_sName = _copy->m_sName;
-
- /* Default variables... */
- currentRecord = 0;
- header = nullptr;
- records = new MacabRecord *[recordsSize];
- recordType = kABPersonRecordType;
-
/* Variables constructed... */
bootstrap_CF_types();
bootstrap_requiredProperties();
@@ -118,17 +102,9 @@ MacabRecords::MacabRecords(const MacabRecords *_copy)
MacabRecords::MacabRecords(const ABAddressBookRef _addressBook)
+ : recordsSize(0), currentRecord(0), recordType(kABPersonRecordType),
+ header(nullptr), records(nullptr), addressBook(_addressBook)
{
- /* Variables passed in... */
- addressBook = _addressBook;
-
- /* Default variables... */
- recordsSize = 0;
- currentRecord = 0;
- records = nullptr;
- header = nullptr;
- recordType = kABPersonRecordType;
-
/* Variables constructed... */
bootstrap_CF_types();
bootstrap_requiredProperties();
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index 149a3123208d..7b0911223d7f 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -53,9 +53,9 @@ MacabResultSet::MacabResultSet(MacabCommonStatement* pStmt)
m_xStatement(pStmt),
m_aMacabRecords(),
m_nRowPos(-1),
- m_bWasNull(true)
+ m_bWasNull(true),
+ m_sTableName(MacabAddressBook::getDefaultTableName())
{
- m_sTableName = MacabAddressBook::getDefaultTableName();
}
MacabResultSet::~MacabResultSet()
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index 10bad0a49a40..5df8a0e3a9ec 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -56,13 +56,13 @@ OStatement::OStatement( OConnection* _pConnection) : OCommonStatement( _pConnect
OCommonStatement::OCommonStatement(OConnection* _pConnection )
:OCommonStatement_IBASE(m_aMutex)
,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
+ ,m_xDBMetaData (_pConnection->getMetaData())
,m_pTable(nullptr)
,m_pConnection(_pConnection)
,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) )
,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser ) )
+ ,m_pParseTree(nullptr)
{
- m_xDBMetaData = _pConnection->getMetaData();
- m_pParseTree = nullptr;
}
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index ddaba5fc9e45..57be21dd6cc5 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -178,8 +178,8 @@ OPreparedResultSet::OPreparedResultSet(OConnection& rConn, OPreparedStatement* p
, m_aStatement(static_cast<OWeakObject*>(pPrepared))
, m_pStmt(pStmt)
, m_encoding(rConn.getConnectionEncoding())
+ , m_nColumnCount(mysql_stmt_field_count(pStmt))
{
- m_nColumnCount = mysql_stmt_field_count(pStmt);
m_pResult = mysql_stmt_result_metadata(m_pStmt);
if (m_pResult != nullptr)
mysql_stmt_store_result(m_pStmt);