From 07e87211c2b2e98fd176fef2018723b50c8dbb1a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Sep 2018 10:33:11 +0200 Subject: loplugin:simplifyconstruct in dbaccess..drawinglayer Change-Id: I83624d8bc787aaaaf6071171c882a6e5bde70a0d Reviewed-on: https://gerrit.libreoffice.org/60075 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/core/api/RowSet.cxx | 1 - dbaccess/source/core/api/RowSetBase.cxx | 2 -- dbaccess/source/core/api/RowSetCache.cxx | 2 -- dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 1 - dbaccess/source/core/api/TableDeco.cxx | 1 - dbaccess/source/core/api/column.cxx | 1 - dbaccess/source/core/api/query.cxx | 1 - dbaccess/source/core/api/tablecontainer.cxx | 1 - dbaccess/source/core/dataaccess/connection.cxx | 2 -- dbaccess/source/core/dataaccess/databasedocument.cxx | 1 - dbaccess/source/core/dataaccess/documentcontainer.cxx | 2 +- dbaccess/source/core/dataaccess/intercept.cxx | 2 -- dbaccess/source/filter/hsqldb/hsqlimport.cxx | 1 - dbaccess/source/filter/hsqldb/rowinputbinary.hxx | 2 +- dbaccess/source/filter/xml/xmlfilter.cxx | 2 +- dbaccess/source/ui/browser/dbexchange.cxx | 6 ------ dbaccess/source/ui/control/RelationControl.cxx | 2 -- dbaccess/source/ui/dlg/dbwiz.cxx | 1 - dbaccess/source/ui/dlg/dbwizsetup.cxx | 1 - dbaccess/source/ui/dlg/indexdialog.cxx | 1 - dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 8 ++++---- dbaccess/source/ui/querydesign/querydlg.cxx | 1 - 22 files changed, 7 insertions(+), 35 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 0564532cba9e..4d2787ef6d2d 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -129,7 +129,6 @@ namespace dbaccess ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext ) :ORowSet_BASE1(m_aMutex) ,ORowSetBase( _rxContext, ORowSet_BASE1::rBHelper, &m_aMutex ) - ,m_pParameters( nullptr ) ,m_aPrematureParamValues(new ORowSetValueVector) ,m_aParameterValueForCache(new ORowSetValueVector) ,m_aRowsetListeners(*m_pMutex) diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 2ad5e37b5412..7518cacf1cd7 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -82,9 +82,7 @@ ORowSetBase::ORowSetBase( const Reference& _rContext, ::cppu: ,m_pMutex(_pMutex) ,m_pMySelf(nullptr) ,m_pCache(nullptr) - ,m_pColumns(nullptr) ,m_rBHelper(_rBHelper) - ,m_pEmptyCollection( nullptr ) ,m_aContext( _rContext ) ,m_nLastColumnIndex(-1) ,m_nDeletedPosition(-1) diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 6180522ff72b..8a05dd9b147a 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -91,8 +91,6 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, :m_xSet(_xRs) ,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData()) ,m_aContext( _rContext ) - ,m_pMatrix(nullptr) - ,m_pInsertMatrix(nullptr) ,m_nFetchSize(0) ,m_nRowCount(0) ,m_nPrivileges( Privilege::SELECT ) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 6d4ba1b0d87c..5a0bead4c8be 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -227,7 +227,6 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc ,m_xMetaData(_xConnection->getMetaData()) ,m_xConnectionTables( _rxTables ) ,m_aContext( _rContext ) - ,m_pTables(nullptr) ,m_nBoolCompareMode( BooleanComparisonMode::EQUAL_INTEGER ) ,m_nCommandType(CommandType::COMMAND) { diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 982f4177947f..69a8169c86ac 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -64,7 +64,6 @@ ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnect ,m_xMetaData( _rxConnection.is() ? _rxConnection->getMetaData() : Reference< XDatabaseMetaData >() ) ,m_xNumberFormats( _rxNumberFormats ) ,m_nPrivileges(-1) - ,m_pColumns(nullptr) { ODataSettings::registerPropertiesFor(this); } diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx index c344b31c21a6..f08da5e73fa6 100644 --- a/dbaccess/source/core/api/column.cxx +++ b/dbaccess/source/core/api/column.cxx @@ -144,7 +144,6 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, bool _bUseHardRef) : OColumns_BASE(_rParent,_bCaseSensitive,_rMutex,_rVector,_bUseHardRef) ,m_pMediator(nullptr) - ,m_xDrvColumns(nullptr) ,m_pColFactoryImpl(_pColFactory) ,m_pRefreshColumns(_pRefresh) ,m_bInitialized(false) diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 6e1eca3faaa5..5ffdde485357 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -73,7 +73,6 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition ,ODataSettings(OContentHelper::rBHelper,true) ,m_xCommandDefinition(_rxCommandDefinition) ,m_xConnection(_rxConn) - ,m_pColumnMediator( nullptr ) ,m_pWarnings( nullptr ) ,m_eDoingCurrently(NONE) { diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 40d520cea975..8e2d0008f8e9 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -103,7 +103,6 @@ OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, std::atomic& _nInAppend) :OFilteredContainer(_rParent,_rMutex,_xCon,_bCase,_pRefreshListener,_nInAppend) ,m_xTableDefinitions(_xTableDefinitions) - ,m_pTableMediator( nullptr ) { } diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 598b4e815c0f..1793af9e5253 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -270,8 +270,6 @@ OConnection::OConnection(ODatabaseSource& _rDB ,m_aTableTypeFilter(_rDB.m_pImpl->m_aTableTypeFilter) ,m_aContext( _rxORB ) ,m_xMasterConnection(_rxMaster) - ,m_pTables(nullptr) - ,m_pViews(nullptr) ,m_aWarnings( Reference< XWarningsSupplier >( _rxMaster, UNO_QUERY ) ) ,m_nInAppend(0) ,m_bSupportsViews(false) diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index af654d1e81be..6e972e9c0ce0 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -144,7 +144,6 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference& ,m_aCloseListener( getMutex() ) ,m_aStorageListeners( getMutex() ) ,m_pEventContainer( new DocumentEvents( *this, getMutex(), _pImpl->getDocumentEvents() ) ) - ,m_pEventExecutor( nullptr ) // initialized below, ref-count-protected ,m_aEventNotifier( *this, getMutex() ) ,m_aViewMonitor( m_aEventNotifier ) ,m_eInitState( NotInitialized ) diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 890361b481e9..d1a40470d067 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -629,7 +629,7 @@ OUString SAL_CALL ODocumentContainer::composeHierarchicalName( const OUString& i ::rtl::Reference ODocumentContainer::getContent(const OUString& _sName) const { - ::rtl::Reference pContent = nullptr; + ::rtl::Reference pContent; try { Reference xUnoTunnel(const_cast(this)->implGetByName( _sName, true ), UNO_QUERY ); diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx index a6837692d691..7cec465d5de2 100644 --- a/dbaccess/source/core/dataaccess/intercept.cxx +++ b/dbaccess/source/core/dataaccess/intercept.cxx @@ -75,8 +75,6 @@ void OInterceptor::dispose() OInterceptor::OInterceptor( ODocumentDefinition* _pContentHolder ) :m_pContentHolder( _pContentHolder ) ,m_aInterceptedURL(7) - ,m_pDisposeEventListeners(nullptr) - ,m_pStatCL(nullptr) { OSL_ENSURE(DISPATCH_RELOAD < m_aInterceptedURL.getLength(),"Illegal size."); diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx index 3ef8d7f099ac..54fdb7411f4d 100644 --- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx +++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx @@ -215,7 +215,6 @@ using namespace css::embed; HsqlImporter::HsqlImporter(Reference& rConnection, const Reference& rStorage) : m_rConnection(rConnection) - , m_xStorage(nullptr) { m_xStorage.set(rStorage); } diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.hxx b/dbaccess/source/filter/hsqldb/rowinputbinary.hxx index 3c66b799dc5a..10196b679992 100644 --- a/dbaccess/source/filter/hsqldb/rowinputbinary.hxx +++ b/dbaccess/source/filter/hsqldb/rowinputbinary.hxx @@ -23,7 +23,7 @@ namespace dbahsql class HsqlRowInputStream { private: - std::unique_ptr m_pStream = nullptr; + std::unique_ptr m_pStream; protected: OUString readString(); diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index a57dc9477bf7..c5f5d58f1545 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -305,7 +305,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) { uno::Reference xCom(GetModel(),UNO_QUERY); - tools::SvRef pMedium(nullptr); + tools::SvRef pMedium; if (!xStorage.is()) { OUString sStreamRelPath; diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 41500c1c5dc3..9f606ab1f6c9 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -66,8 +66,6 @@ namespace dbaui const Reference< XNumberFormatter >& _rxFormatter, const Reference< XComponentContext >& _rxORB) :ODataAccessObjectTransferable( _rDatasource, _nCommandType, _rCommand, _rxConnection ) - ,m_pHtml(nullptr) - ,m_pRtf(nullptr) { osl_atomic_increment( &m_refCount ); lcl_setListener( _rxConnection, this, true ); @@ -85,8 +83,6 @@ namespace dbaui const Reference< XNumberFormatter >& _rxFormatter, const Reference< XComponentContext >& _rxORB) :ODataAccessObjectTransferable( _rDatasource, _nCommandType, _rCommand) - ,m_pHtml(nullptr) - ,m_pRtf(nullptr) { m_pHtml.set( new OHTMLImportExport( getDescriptor(),_rxORB, _rxFormatter ) ); m_pRtf.set( new ORTFImportExport( getDescriptor(),_rxORB, _rxFormatter ) ); @@ -97,8 +93,6 @@ namespace dbaui const bool i_bBookmarkSelection, const Reference< XComponentContext >& i_rORB ) :ODataAccessObjectTransferable( i_rAliveForm ) - ,m_pHtml(nullptr) - ,m_pRtf(nullptr) { OSL_PRECOND( i_rORB.is(), "ODataClipboard::ODataClipboard: having no factory is not good ..." ); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index da01c624dbef..068db126efff 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -132,8 +132,6 @@ namespace dbaui BrowserMode::AUTOSIZE_LASTCOL) , m_pBoxControl(nullptr) , m_nDataPos(0) - , m_xSourceDef(nullptr) - , m_xDestDef(nullptr) { } diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 106f028f029e..b5844a90ad55 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -69,7 +69,6 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent ,const css::uno::Any& _aDataSourceName ) :OWizardMachine(_pParent, WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP ) - ,m_pOutSet(nullptr) { m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB,this,this)); m_pImpl->setDataSourceOrName(_aDataSourceName); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index fc6bd8996ae1..864d4c02480e 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -107,7 +107,6 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent ) :svt::RoadmapWizard( _pParent ) - , m_pOutSet(nullptr) , m_bIsConnectable( false) , m_sRM_IntroText( DBA_RES( STR_PAGETITLE_INTROPAGE ) ) , m_sRM_dBaseText( DBA_RES( STR_PAGETITLE_DBASE ) ) diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index e5b4effc40b4..a4a460e6947d 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -163,7 +163,6 @@ namespace dbaui const Reference< XComponentContext >& _rxContext) :ModalDialog( _pParent, "IndexDesignDialog", "dbaccess/ui/indexdesigndialog.ui") ,m_xConnection(_rxConnection) - ,m_pIndexes(nullptr) ,m_pPreviousSelection(nullptr) ,m_bEditAgain(false) ,m_xContext(_rxContext) diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 384698df1aa9..604f9bd66ec0 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -893,7 +893,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef co bool OSelectionBrowseBox::SaveModified() { OQueryController& rController = static_cast(getDesignView()->getController()); - OTableFieldDescRef pEntry = nullptr; + OTableFieldDescRef pEntry; sal_uInt16 nCurrentColumnPos = GetColumnPos(GetCurColumnId()); if(getFields().size() > static_cast(nCurrentColumnPos - 1)) pEntry = getEntry(nCurrentColumnPos - 1); @@ -1220,7 +1220,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const tools::Rectangle& { rDev.SetClipRegion(vcl::Region(rRect)); - OTableFieldDescRef pEntry = nullptr; + OTableFieldDescRef pEntry; sal_uInt16 nPos = GetColumnPos(nColumnId); if(getFields().size() > sal_uInt16(nPos - 1)) pEntry = getFields()[nPos - 1]; @@ -1434,7 +1434,7 @@ void OSelectionBrowseBox::DeleteFields(const OUString& rAliasName) DeactivateCell(); OTableFields::const_reverse_iterator aIter = getFields().rbegin(); - OTableFieldDescRef pEntry = nullptr; + OTableFieldDescRef pEntry; for(sal_uInt16 nPos=sal::static_int_cast< sal_uInt16 >(getFields().size());aIter != getFields().rend();++aIter,--nPos) { pEntry = *aIter; @@ -2656,7 +2656,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry) Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) { - OTableFieldDescRef pEntry = nullptr; + OTableFieldDescRef pEntry; if(getFields().size() > sal_uInt16(_nColumnPos - 1)) pEntry = getFields()[_nColumnPos - 1]; diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index fc5108442506..2fa5ab16f66e 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -47,7 +47,6 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, const Reference< XConnection >& _xConnection, bool _bAllowTableSelect) : ModalDialog( pParent, "JoinDialog", "dbaccess/ui/joindialog.ui" ) - , m_pTableControl( nullptr ) , eJoinType(static_cast(_pData.get())->GetJoinType()) , m_pOrigConnData(_pData) , m_xConnection(_xConnection) -- cgit