From 1a26e950ab844f566701cecf32ca812e2e28a8cd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 5 Apr 2020 21:33:59 +0200 Subject: loplugin:unusedvariableplus in dbaccess Change-Id: Id2c2416443b2c9d6d516513ee543542e9681f69a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91728 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/qa/unit/hsql_binary_import.cxx | 1 - dbaccess/qa/unit/tdf119625.cxx | 1 - dbaccess/qa/unit/tdf126268.cxx | 1 - dbaccess/source/core/api/CacheSet.cxx | 3 --- dbaccess/source/core/api/KeySet.cxx | 6 ------ dbaccess/source/core/misc/DatabaseDataProvider.cxx | 2 -- dbaccess/source/filter/xml/xmlfilter.cxx | 1 - dbaccess/source/ui/app/AppDetailPageHelper.cxx | 1 - dbaccess/source/ui/app/AppIconControl.cxx | 2 +- dbaccess/source/ui/browser/unodatbr.cxx | 10 +--------- dbaccess/source/ui/dlg/queryorder.cxx | 2 -- dbaccess/source/ui/querydesign/QueryTableView.cxx | 1 - dbaccess/source/ui/querydesign/TableConnectionData.cxx | 1 - dbaccess/source/ui/querydesign/querycontainerwindow.cxx | 3 ++- 14 files changed, 4 insertions(+), 31 deletions(-) diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx index 604c2e0e0560..fbf12f929019 100644 --- a/dbaccess/qa/unit/hsql_binary_import.cxx +++ b/dbaccess/qa/unit/hsql_binary_import.cxx @@ -32,7 +32,6 @@ public: void HsqlBinaryImportTest::setUp() { DBTestBase::setUp(); - SvtMiscOptions aMiscOptions; osl_setEnvironment(OUString{ "DBACCESS_HSQL_MIGRATION" }.pData, OUString{ "1" }.pData); } diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx index 339c2cf163a2..8431c5426e90 100644 --- a/dbaccess/qa/unit/tdf119625.cxx +++ b/dbaccess/qa/unit/tdf119625.cxx @@ -33,7 +33,6 @@ public: void Tdf119625Test::setUp() { DBTestBase::setUp(); - SvtMiscOptions aMiscOptions; osl_setEnvironment(OUString{ "DBACCESS_HSQL_MIGRATION" }.pData, OUString{ "1" }.pData); } diff --git a/dbaccess/qa/unit/tdf126268.cxx b/dbaccess/qa/unit/tdf126268.cxx index 2f24cbbda813..b0719936f588 100644 --- a/dbaccess/qa/unit/tdf126268.cxx +++ b/dbaccess/qa/unit/tdf126268.cxx @@ -32,7 +32,6 @@ public: void Tdf126268Test::setUp() { DBTestBase::setUp(); - SvtMiscOptions aMiscOptions; osl_setEnvironment(OUString{ "DBACCESS_HSQL_MIGRATION" }.pData, OUString{ "1" }.pData); } diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index a1c5430ac343..b8877358e604 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -317,9 +317,6 @@ void OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQ OUStringBuffer aSql("DELETE FROM " + m_aComposedTableName + " WHERE "); // use keys and indexes for exact positioning - // first the keys - const Reference xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xSet); - // second the indexes Reference xIndexSup(_xTable,UNO_QUERY); Reference xIndexes; if(xIndexSup.is()) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index f7a3c4ed7847..d50d9e850080 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -451,10 +451,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi OUString sParam(" = ?"); // use keys and indexes for exact positioning - // first the keys - Reference xKeyColumns = getKeyColumns(); - - // second the indexes Reference xIndexSup(_xTable,UNO_QUERY); Reference xIndexes; if ( xIndexSup.is() ) @@ -843,8 +839,6 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa static const char aAnd[] = " AND "; // use keys and indexes for exact positioning - Reference xKeyColumns = getKeyColumns(); - // second the indexes Reference xIndexSup(_xTable,UNO_QUERY); Reference xIndexes; if ( xIndexSup.is() ) diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 9c423950daba..b5179e57b32f 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -79,8 +79,6 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex void SAL_CALL DatabaseDataProvider::disposing() { - lang::EventObject aEvt(static_cast(this)); - m_aParameterManager.dispose(); // (to free any references it may have to me) m_aFilterManager.dispose(); // (dito) diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 3857b84f97cc..10c28a6d00bc 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -279,7 +279,6 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) if ( bRet ) { - uno::Reference xCom(GetModel(),UNO_QUERY); tools::SvRef pMedium; if (!xStorage.is()) diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 2c6584f68f01..9a126059522d 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -560,7 +560,6 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon pTreeView->SetHelpId(HID_APP_TABLE_TREE); m_pLists[E_TABLE] = pTreeView; - ImageProvider aImageProvider( _xConnection ); createTree( pTreeView, ImageProvider::getDefaultImage( DatabaseObject::TABLE ) ); diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 831d20cf4a1f..569692f39326 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -71,7 +71,7 @@ void OApplicationIconControl::dispose() SvxIconChoiceCtrlEntry* pEntry = GetEntry( i ); if ( pEntry ) { - std::unique_ptr aType(static_cast(pEntry->GetUserData())); + delete static_cast(pEntry->GetUserData()); pEntry->SetUserData(nullptr); } } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index ff34dfa9282b..641dd537a861 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2164,8 +2164,8 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvTreeListEntry*, _pParent, bool) if (xWarnings.is()) { - SQLExceptionInfo aWarnings(xWarnings->getWarnings()); #if 0 + SQLExceptionInfo aWarnings(xWarnings->getWarnings()); // Obviously this if test is always false. So to avoid a Clang warning // "use of logical '&&' with constant operand" I put this in #if // 0. Yeah, I know it is fairly likely nobody will ever read this @@ -2962,14 +2962,6 @@ void SbaTableQueryBrowser::unloadAndCleanup( bool _bDisposeConnection ) try { // get the active connection. We need to dispose it. - Reference< XPropertySet > xRowSetProps(getRowSet(),UNO_QUERY); -#if OSL_DEBUG_LEVEL > 0 - { - Reference< XComponent > xComp( - xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION), - css::uno::UNO_QUERY); - } -#endif // unload the form Reference< XLoadable > xLoadable = getLoadable(); diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index 1be97ad25ec9..292e90621863 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -196,8 +196,6 @@ OUString DlgOrderCrit::GetOrderList( ) const Reference xMetaData = m_xConnection->getMetaData(); OUString sQuote = xMetaData.is() ? xMetaData->getIdentifierQuoteString() : OUString(); - Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns(); - OUStringBuffer sOrder; for( sal_uInt16 i=0 ; i xReferencedKeys( _rDest.GetData()->getKeys()); OUString sRelatedColumn; // iterate through all foreignkey columns to create the connections diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 760e1e0aec3a..f8498f058e52 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -133,7 +133,6 @@ OConnectionLineDataVec::size_type OTableConnectionData::normalizeLines() { if(m_vConnLineData[i]->GetSourceFieldName().isEmpty() && m_vConnLineData[i]->GetDestFieldName().isEmpty()) { - OConnectionLineDataRef pData = m_vConnLineData[i]; m_vConnLineData.erase(m_vConnLineData.begin()+i); --nCount; if (i < nRet) diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 572d8354683a..7361421378a4 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -62,8 +62,9 @@ namespace dbaui void OQueryContainerWindow::dispose() { { - std::unique_ptr aTemp(m_pViewSwitch); + OQueryViewSwitch* pTemp = m_pViewSwitch; m_pViewSwitch = nullptr; + delete pTemp; } if ( m_pBeamer ) ::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); -- cgit