diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-17 15:21:54 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-18 08:33:50 +0000 |
commit | dd351c8524b270d1fd0f61998e10dba0ccd624b6 (patch) | |
tree | 9258389b18dfa876636cf4cc468672f79c95a0a9 /dbaccess | |
parent | 4f250922ac59142e6e35e5663ffeefcc14052073 (diff) |
loplugin:constantparam in dbaccess
Change-Id: Icfe7d3d4630f4b5b3b2491ba56245257bad31bb8
Reviewed-on: https://gerrit.libreoffice.org/23349
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'dbaccess')
20 files changed, 34 insertions, 55 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index f97daac96524..693e589621c9 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -508,7 +508,7 @@ OUString OSingleSelectQueryComposer::impl_getColumnRealName_throw(const Referenc return aNewName; } -OUString OSingleSelectQueryComposer::impl_getColumnName_throw(const Reference< XPropertySet >& column, bool bOrderBy) +OUString OSingleSelectQueryComposer::impl_getColumnNameOrderBy_throw(const Reference< XPropertySet >& column) { ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); @@ -537,8 +537,7 @@ OUString OSingleSelectQueryComposer::impl_getColumnName_throw(const Reference< X // Nope, it is an unrelated column. // Is that supported? - if ( bOrderBy && - !m_xMetaData->supportsOrderByUnrelated() ) + if ( !m_xMetaData->supportsOrderByUnrelated() ) { OUString sError(DBACORE_RESSTRING(RID_STR_COLUMN_MUST_VISIBLE)); throw SQLException(sError.replaceAll("%name", aName),*this,SQLSTATE_GENERAL,1000,Any() ); @@ -551,7 +550,7 @@ OUString OSingleSelectQueryComposer::impl_getColumnName_throw(const Reference< X void SAL_CALL OSingleSelectQueryComposer::appendOrderByColumn( const Reference< XPropertySet >& column, sal_Bool ascending ) throw(SQLException, RuntimeException, std::exception) { ::osl::MutexGuard aGuard( m_aMutex ); - OUString sColumnName( impl_getColumnName_throw(column, true) ); + OUString sColumnName( impl_getColumnNameOrderBy_throw(column) ); OUString sOrder = getOrder(); if ( !(sOrder.isEmpty() || sColumnName.isEmpty()) ) sOrder += COMMA; diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index c8e9552e7f46..8269119ed901 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -187,15 +187,13 @@ namespace dbaccess */ OUString impl_getColumnRealName_throw(const css::uno::Reference< css::beans::XPropertySet >& column, bool bGroupBy); - /** return the name of the column in the *query* + /** return the name of the column in the *query* for ORDER BY clause. That is, for (SELECT a AS b FROM t), it returns "b" - Use e.g. for ORDER BY clause. - - @param bOrderBy: for ORDER BY clause? In that case, throw exception if trying to use an unrelated column and the database does not support that. + Throws exception if trying to use an unrelated column and the database does not support that. */ - OUString impl_getColumnName_throw(const css::uno::Reference< css::beans::XPropertySet >& column, bool bOrderBy); + OUString impl_getColumnNameOrderBy_throw(const css::uno::Reference< css::beans::XPropertySet >& column); protected: virtual ~OSingleSelectQueryComposer(); diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx index a17ddf870019..6a3f59fc22ee 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.cxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx @@ -50,8 +50,8 @@ using namespace xmloff::token; OTableStyleContext::OTableStyleContext( ODBFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle ) - :XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, bDefaultStyle ) + SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) + :XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, false ) ,pStyles(&rStyles) ,m_nNumberFormat(-1) { diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx index fbb96256dce2..2ff8046b605b 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.hxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx @@ -57,7 +57,7 @@ namespace dbaxml OTableStyleContext( ODBFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle = false ); + SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); virtual ~OTableStyleContext(); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 60fac0fc5978..5763216bd410 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2393,7 +2393,7 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const if ( eType != E_NONE && (eType != E_TABLE || !isConnectionReadOnly()) ) { // check for the concrete type - if(::std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType,true))) + if(::std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType))) return DND_ACTION_COPY; if ( eType == E_FORM || eType == E_REPORT ) { diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 763265b908d2..3a36c028a9db 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -523,7 +523,7 @@ void OTasksWindow::Clear() // class OApplicationDetailView -OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode) : OSplitterView(&_rParent,false ) +OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode) : OSplitterView(&_rParent ) ,m_aHorzSplitter(VclPtr<Splitter>::Create(this)) ,m_aTasks(VclPtr<dbaui::OTitleWindow>::Create(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL) ) ,m_aContainer(VclPtr<dbaui::OTitleWindow>::Create(this,0,WB_BORDER | WB_DIALOGCONTROL) ) diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index c1fd6697ed21..6591a859ac0e 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -109,7 +109,7 @@ namespace dbaui if ( xChild.is() ) xStore.set( getDataSourceOrModel(xChild->getParent()), UNO_QUERY ); // check for the concrete type - if ( xStore.is() && !xStore->isReadonly() && ::std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(E_TABLE,true)) ) + if ( xStore.is() && !xStore->isReadonly() && ::std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(E_TABLE)) ) return DND_ACTION_COPY; } } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 5a8213a89958..5dc64f80b98e 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1035,7 +1035,7 @@ void SbaTableQueryBrowser::checkDocumentDataSource() { SvTreeListEntry* pDataSourceEntry = nullptr; SvTreeListEntry* pContainerEntry = nullptr; - SvTreeListEntry* pObjectEntry = getObjectEntry( m_aDocumentDataSource, &pDataSourceEntry, &pContainerEntry, false ); + SvTreeListEntry* pObjectEntry = getObjectEntry( m_aDocumentDataSource, &pDataSourceEntry, &pContainerEntry ); bool bKnownDocDataSource = (nullptr != pObjectEntry); if (!bKnownDocDataSource) { @@ -1251,8 +1251,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour } SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const svx::ODataAccessDescriptor& _rDescriptor, - SvTreeListEntry** _ppDataSourceEntry, SvTreeListEntry** _ppContainerEntry, - bool _bExpandAncestors) + SvTreeListEntry** _ppDataSourceEntry, SvTreeListEntry** _ppContainerEntry) { // extract the props from the descriptor OUString sDataSource; @@ -1261,7 +1260,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const svx::ODataAccessDesc bool bEscapeProcessing = true; extractDescriptorProps(_rDescriptor, sDataSource, sCommand, nCommandType, bEscapeProcessing); - return getObjectEntry( sDataSource, sCommand, nCommandType, _ppDataSourceEntry, _ppContainerEntry, _bExpandAncestors ); + return getObjectEntry( sDataSource, sCommand, nCommandType, _ppDataSourceEntry, _ppContainerEntry, false/*_bExpandAncestors*/ ); } void SbaTableQueryBrowser::connectExternalDispatches() diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx index 2b063e207371..bf9dd114b3cf 100644 --- a/dbaccess/source/ui/control/VertSplitView.cxx +++ b/dbaccess/source/ui/control/VertSplitView.cxx @@ -28,11 +28,11 @@ using namespace ::dbaui; // class OSplitterView -OSplitterView::OSplitterView(vcl::Window* _pParent,bool _bVertical) : Window(_pParent,WB_DIALOGCONTROL) // ,WB_BORDER +OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGCONTROL) // ,WB_BORDER ,m_pSplitter( nullptr ) ,m_pLeft(nullptr) ,m_pRight(nullptr) - ,m_bVertical(_bVertical) + ,m_bVertical(false) { ImplInitSettings(); } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 7142e295d8e0..adcff3ee227c 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -54,12 +54,12 @@ using namespace ::com::sun::star::view; #define SPACEBETWEENENTRIES 4 // class DBTreeListBox -DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle ,bool _bHandleEnterKey) +DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle ) :SvTreeListBox(pParent,nWinStyle) ,m_pDragedEntry(nullptr) ,m_pActionListener(nullptr) ,m_pContextMenuProvider( nullptr ) - ,m_bHandleEnterKey(_bHandleEnterKey) + ,m_bHandleEnterKey(false) { init(); } diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 760f82b917cb..8a6a50d1d6a5 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -167,7 +167,7 @@ void ODbaseIndexDialog::implInsertIndex(const OTableIndex& _rIndex, TableIndexLi _rDisplay.SelectEntryPos(0); } -OTableIndex ODbaseIndexDialog::RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName, bool _bMustExist ) +OTableIndex ODbaseIndexDialog::RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName ) { OTableIndex aReturn; @@ -176,7 +176,7 @@ OTableIndex ODbaseIndexDialog::RemoveTableIndex( const OUString& _rTableName, co if (!GetTable(_rTableName, aTablePos)) return aReturn; - return implRemoveIndex(_rIndexName, aTablePos->aIndexList, *m_pLB_TableIndexes, _bMustExist); + return implRemoveIndex(_rIndexName, aTablePos->aIndexList, *m_pLB_TableIndexes, true/*_bMustExist*/); } void ODbaseIndexDialog::InsertTableIndex( const OUString& _rTableName, const OTableIndex& _rIndex) @@ -215,7 +215,7 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveClickHdl, Button*, void ) { OUString aSelection = m_pLB_TableIndexes->GetSelectEntry(); OUString aTableName = m_pCB_Tables->GetText(); - OTableIndex aIndex = RemoveTableIndex( aTableName, aSelection, true ); + OTableIndex aIndex = RemoveTableIndex( aTableName, aSelection ); InsertFreeIndex( aIndex ); checkButtons(); @@ -238,7 +238,7 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveAllClickHdl, Button*, void ) OUString aTableName = m_pCB_Tables->GetText(); for( sal_Int32 nPos = 0; nPos < nCnt; ++nPos ) - InsertFreeIndex( RemoveTableIndex( aTableName, m_pLB_TableIndexes->GetEntry(0), true ) ); + InsertFreeIndex( RemoveTableIndex( aTableName, m_pLB_TableIndexes->GetEntry(0) ) ); checkButtons(); } diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index e7fcbd76d755..d4f3b6771674 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -105,7 +105,7 @@ protected: OTableIndex RemoveFreeIndex( const OUString& _rName, bool _bMustExist ) { return implRemoveIndex(_rName, m_aFreeIndexList, *m_pLB_FreeIndexes, _bMustExist); } void InsertFreeIndex( const OTableIndex& _rIndex ) { implInsertIndex(_rIndex, m_aFreeIndexList, *m_pLB_FreeIndexes); } - OTableIndex RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName, bool _bMustExist ); + OTableIndex RemoveTableIndex( const OUString& _rTableName, const OUString& _rIndexName ); void InsertTableIndex( const OUString& _rTableName, const OTableIndex& _rIndex ); void checkButtons(); diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index ee2b0ba7b442..7ae9087b407b 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -282,7 +282,7 @@ namespace dbaui m_pSQL->GrabFocus(); } - void DirectSQLDialog::switchToHistory(sal_Int32 _nHistoryPos, bool _bUpdateListBox) + void DirectSQLDialog::switchToHistory(sal_Int32 _nHistoryPos) { CHECK_INVARIANTS("DirectSQLDialog::switchToHistory"); @@ -293,14 +293,6 @@ namespace dbaui m_pSQL->SetText(sStatement); OnStatementModified(*m_pSQL); - if (_bUpdateListBox) - { - // select the normalized statement in the list box - m_pSQLHistory->SelectEntryPos((sal_uInt16)_nHistoryPos); - OSL_ENSURE(m_pSQLHistory->GetSelectEntry() == m_aNormalizedHistory[_nHistoryPos], - "DirectSQLDialog::switchToHistory: inconsistent listbox entries!"); - } - m_pSQL->GrabFocus(); m_pSQL->SetSelection(Selection(sStatement.getLength(), sStatement.getLength())); } @@ -333,7 +325,7 @@ namespace dbaui { const sal_Int32 nSelected = m_pSQLHistory->GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nSelected) - switchToHistory(nSelected, false); + switchToHistory(nSelected); } } diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 1ca5043be4bb..bb5ab1608474 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -35,14 +35,12 @@ using namespace dbaui; SbaSbAttrDlg::SbaSbAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs, - SvNumberFormatter* pFormatter, bool bHasFormat, bool bRow) + SvNumberFormatter* pFormatter, bool bHasFormat) : SfxTabDialog(pParent, "FieldDialog", "dbaccess/ui/fielddialog.ui", pCellAttrs) , m_nNumberFormatId(0) { pNumberInfoItem = new SvxNumberInfoItem( pFormatter, 0 ); - if (bRow) - SetText(get<FixedText>("alttitle")->GetText()); if (bHasFormat) m_nNumberFormatId = AddTabPage("format", RID_SVXPAGE_NUMBERFORMAT); else diff --git a/dbaccess/source/ui/inc/TableCopyHelper.hxx b/dbaccess/source/ui/inc/TableCopyHelper.hxx index 98e0169d543e..1a3c00a47f27 100644 --- a/dbaccess/source/ui/inc/TableCopyHelper.hxx +++ b/dbaccess/source/ui/inc/TableCopyHelper.hxx @@ -36,10 +36,8 @@ namespace dbaui struct TAppSupportedSotFunctor : ::std::unary_function<DataFlavorExVector::value_type,bool> { ElementType eEntryType; - bool bQueryDrop; - TAppSupportedSotFunctor(const ElementType& _eEntryType,bool _bQueryDrop) + TAppSupportedSotFunctor(const ElementType& _eEntryType) : eEntryType(_eEntryType) - , bQueryDrop(_bQueryDrop) { } @@ -53,7 +51,7 @@ namespace dbaui return (E_TABLE == eEntryType); case SotClipboardFormatId::DBACCESS_QUERY: // query descriptor case SotClipboardFormatId::DBACCESS_COMMAND: // SQL command - return ((E_QUERY == eEntryType) || ( !bQueryDrop && E_TABLE == eEntryType)); + return E_QUERY == eEntryType; default: break; } return false; diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index bdc95a51e054..03e40961992d 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -37,7 +37,7 @@ namespace dbaui protected: virtual void DataChanged(const DataChangedEvent& rDCEvt) override; public: - OSplitterView(vcl::Window* _pParent,bool _bVertical = true); + OSplitterView(vcl::Window* _pParent); virtual ~OSplitterView(); // Window overrides virtual void dispose() override; diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index f5ec587b8dff..7df484b95eae 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -78,9 +78,7 @@ namespace dbaui DECL_LINK_TYPED( ScrollDownHdl, LinkParamNone*, void ); public: - DBTreeListBox( vcl::Window* pParent - ,WinBits nWinStyle=0 - ,bool _bHandleEnterKey = false); + DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle=0); virtual ~DBTreeListBox(); virtual void dispose() override; diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index fb1fb1080ee3..aba8f30d7e67 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -79,7 +79,7 @@ namespace dbaui protected: void executeCurrent(); - void switchToHistory(sal_Int32 _nHistoryPos, bool _bUpdateListBox = true); + void switchToHistory(sal_Int32 _nHistoryPos); // OEventListenerAdapter virtual void _disposing( const css::lang::EventObject& _rSource ) override; diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index 4edb12c484f9..2017654875ce 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -33,7 +33,7 @@ namespace dbaui sal_uInt32 m_nNumberFormatId; public: - SbaSbAttrDlg(vcl::Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat, bool bRow = false); + SbaSbAttrDlg(vcl::Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat); virtual ~SbaSbAttrDlg(); virtual void dispose() override; diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index ca3daa2cb096..02673fb6a1fb 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -389,12 +389,9 @@ namespace dbaui If not <NULL/>, the data source tree entry will be returned here @param _ppContainerEntry If not <NULL/>, the object container tree entry will be returned here - @param _bExpandAncestors - If <TRUE/>, all ancestor on the way to the entry will be expanded */ SvTreeListEntry* getObjectEntry(const svx::ODataAccessDescriptor& _rDescriptor, - SvTreeListEntry** _ppDataSourceEntry = nullptr, SvTreeListEntry** _ppContainerEntry = nullptr, - bool _bExpandAncestors = true + SvTreeListEntry** _ppDataSourceEntry = nullptr, SvTreeListEntry** _ppContainerEntry = nullptr ); /** retrieves the tree entry for the object described by data source name, command and command type @param _rDataSource |