diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-04 15:05:38 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 10:48:13 +0000 |
commit | 3c99f8500f657ed84b316390d5175a6f5e56bc69 (patch) | |
tree | 749f16652560a50d409b12a23bf1a5d93b3cd2d5 /dbaccess/source/ui/dlg | |
parent | bbadb38539eb233ac45b267034066a7274181c65 (diff) |
convert Link<> to typed
Change-Id: Iec15042138e0715459b2c9e872a7464d75a6b1eb
Reviewed-on: https://gerrit.libreoffice.org/19305
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbfindex.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbfindex.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/directsql.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/indexfieldscontrol.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 19 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryfilter.cxx | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryorder.cxx | 3 |
17 files changed, 60 insertions, 44 deletions
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 8139d8805b83..bbe4db6bfbb6 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -99,7 +99,7 @@ namespace dbaui m_pFieldSeparator->SetSelectHdl(getControlModifiedLink()); m_pTextSeparator->SetUpdateDataHdl(getControlModifiedLink()); m_pTextSeparator->SetSelectHdl(getControlModifiedLink()); - m_pCharSet->SetSelectHdl(getControlModifiedLink()); + m_pCharSet->SetSelectHdl(LINK(this, OTextConnectionHelper, CharsetSelectHdl)); m_pFieldSeparator->SetModifyHdl(getControlModifiedLink()); m_pTextSeparator->SetModifyHdl(getControlModifiedLink()); @@ -151,6 +151,11 @@ namespace dbaui Show(); } + IMPL_LINK_TYPED(OTextConnectionHelper, CharsetSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + OTextConnectionHelper::~OTextConnectionHelper() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index 6a2f1d90f8fb..89474ed541b1 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -85,6 +85,7 @@ namespace dbaui DECL_LINK_TYPED(OnSetExtensionHdl,RadioButton&,void); DECL_LINK(OnControlModified,Control*); DECL_LINK(OnEditModified,Edit*); + DECL_LINK_TYPED(CharsetSelectHdl,ListBox&,void); private: OUString GetSeparator( const ComboBox& rBox, const OUString& rList ); diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index e4a7c8d46e9a..023bccd470e9 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -275,13 +275,12 @@ IMPL_LINK_TYPED( OUserAdmin, UserHdl, Button *, pButton, void ) } } -IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( OUserAdmin, ListDblClickHdl, ListBox&, void ) { m_TableCtrl->setUserName(GetUser()); m_TableCtrl->UpdateTables(); m_TableCtrl->DeactivateCell(); m_TableCtrl->ActivateCell(m_TableCtrl->GetCurRow(),m_TableCtrl->GetCurColumnId()); - return 0; } OUString OUserAdmin::GetUser() diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 7e5682103130..6cf91135bb7c 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -55,7 +55,7 @@ protected: OUString m_UserName; // methods - DECL_LINK( ListDblClickHdl, ListBox * ); + DECL_LINK_TYPED( ListDblClickHdl, ListBox&, void ); DECL_LINK_TYPED( UserHdl, Button *, void ); void FillUserNames(); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 2c2dbbef65d7..513d939a0073 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -120,7 +120,7 @@ namespace dbaui get(m_pBooleanComparisonModeLabel, "comparisonft"); get(m_pBooleanComparisonMode, "comparison"); m_pBooleanComparisonMode->SetDropDownLineCount( 4 ); - m_pBooleanComparisonMode->SetSelectHdl( getControlModifiedLink() ); + m_pBooleanComparisonMode->SetSelectHdl( LINK(this, SpecialSettingsPage, BooleanComparisonSelectHdl) ); m_pBooleanComparisonModeLabel->Show(); m_pBooleanComparisonMode->Show(); } @@ -136,6 +136,11 @@ namespace dbaui } } + IMPL_LINK_TYPED(SpecialSettingsPage, BooleanComparisonSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + SpecialSettingsPage::~SpecialSettingsPage() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index b6054d413a55..9d31cd4f2918 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -91,6 +91,7 @@ namespace dbaui private: void impl_initBooleanSettings(); + DECL_LINK_TYPED(BooleanComparisonSelectHdl, ListBox&, void); }; // GeneratedValuesPage diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index f86314a3155b..26fe737feb97 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -243,10 +243,9 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveAllClickHdl, Button*, void ) checkButtons(); } -IMPL_LINK( ODbaseIndexDialog, OnListEntrySelected, ListBox*, /*NOTINTERESTEDIN*/ ) +IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, OnListEntrySelected, ListBox&, void ) { checkButtons(); - return 0; } IMPL_LINK( ODbaseIndexDialog, TableSelectHdl, ComboBox*, pComboBox ) diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index be5ac35d6b7e..9cf8ac1ada4c 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -89,7 +89,7 @@ protected: DECL_LINK_TYPED( AddAllClickHdl, Button*, void ); DECL_LINK_TYPED( RemoveAllClickHdl, Button*, void ); DECL_LINK_TYPED( OKClickHdl, Button*, void ); - DECL_LINK( OnListEntrySelected, ListBox* ); + DECL_LINK_TYPED( OnListEntrySelected, ListBox&, void ); OUString m_aDSN; TableInfoList m_aTableInfoList; diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 18943cbf3c26..bf8d8569ad18 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -90,10 +90,15 @@ namespace dbaui m_pCharsetLabel->Show(); m_pCharset = get<CharSetListBox>("charset"); m_pCharset->Show(); - m_pCharset->SetSelectHdl(getControlModifiedLink()); + m_pCharset->SetSelectHdl(LINK(this, OCommonBehaviourTabPage, CharsetSelectHdl)); } } + IMPL_LINK_TYPED(OCommonBehaviourTabPage, CharsetSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + OCommonBehaviourTabPage::~OCommonBehaviourTabPage() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 7ab4d970a469..c035af296823 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -82,6 +82,8 @@ namespace dbaui // <method>OGenericAdministrationPage::fillWindows</method> virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; + private: + DECL_LINK_TYPED(CharsetSelectHdl, ListBox&, void); }; // ODbaseDetailsPage diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 30885ab5cc5f..7647308875a8 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -328,7 +328,7 @@ namespace dbaui executeCurrent(); } - IMPL_LINK_NOARG( DirectSQLDialog, OnListEntrySelected ) + IMPL_LINK_NOARG_TYPED( DirectSQLDialog, OnListEntrySelected, ListBox&, void ) { if (!m_pSQLHistory->IsTravelSelect()) { @@ -336,7 +336,6 @@ namespace dbaui if (LISTBOX_ENTRY_NOTFOUND != nSelected) switchToHistory(nSelected, false); } - return 0L; } } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 7286e93acb0c..23ecc2a54ed3 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -406,14 +406,14 @@ namespace dbaui OGenericAdministrationPage::Reset(_rCoreAttrs); } - IMPL_LINK( OGeneralPageWizard, OnEmbeddedDBTypeSelected, ListBox*, _pBox ) + IMPL_LINK_TYPED( OGeneralPageWizard, OnEmbeddedDBTypeSelected, ListBox&, _rBox, void ) { // get the type from the entry data - const sal_Int32 nSelected = _pBox->GetSelectEntryPos(); + const sal_Int32 nSelected = _rBox.GetSelectEntryPos(); if (static_cast<size_t>(nSelected) >= m_aEmbeddedURLPrefixes.size() ) { SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectEntryPos(): no corresponding URL prefix"); - return 0L; + return; } const OUString sURLPrefix = m_aEmbeddedURLPrefixes[ nSelected ]; @@ -423,17 +423,17 @@ namespace dbaui // tell the listener we were modified callModifiedHdl(); // outta here - return 0L; + return; } - IMPL_LINK( OGeneralPage, OnDatasourceTypeSelected, ListBox*, _pBox ) + IMPL_LINK_TYPED( OGeneralPage, OnDatasourceTypeSelected, ListBox&, _rBox, void ) { // get the type from the entry data - const sal_Int32 nSelected = _pBox->GetSelectEntryPos(); + const sal_Int32 nSelected = _rBox.GetSelectEntryPos(); if (static_cast<size_t>(nSelected) >= m_aURLPrefixes.size() ) { SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectEntryPos(): no corresponding URL prefix"); - return 0L; + return; } const OUString sURLPrefix = m_aURLPrefixes[ nSelected ]; @@ -442,8 +442,6 @@ namespace dbaui onTypeSelected( sURLPrefix ); // tell the listener we were modified callModifiedHdl(); - // outta here - return 0L; } // OGeneralPageDialog @@ -704,20 +702,19 @@ namespace dbaui if ( m_aCreationModeHandler.IsSet() ) m_aCreationModeHandler.Call( *this ); - OnEmbeddedDBTypeSelected( m_pEmbeddedDBType ); + OnEmbeddedDBTypeSelected( *m_pEmbeddedDBType ); } IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnSetupModeSelected, Button*, void ) { if ( m_aCreationModeHandler.IsSet() ) m_aCreationModeHandler.Call( *this ); - OnDatasourceTypeSelected(m_pDatasourceType); + OnDatasourceTypeSelected(*m_pDatasourceType); } - IMPL_LINK( OGeneralPageWizard, OnDocumentSelected, ListBox*, /*_pBox*/ ) + IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnDocumentSelected, ListBox&, void ) { m_aDocumentSelectionHandler.Call( *this ); - return 0L; } IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnOpenDocument, Button*, void ) diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index f7f05720f4e0..5330cc8fab65 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -97,7 +97,7 @@ namespace dbaui /// sets the title of the parent dialog virtual void setParentTitle( const OUString& _sURLPrefix ); - DECL_LINK(OnDatasourceTypeSelected, ListBox*); + DECL_LINK_TYPED(OnDatasourceTypeSelected, ListBox&, void); }; // OGeneralPageDialog @@ -185,10 +185,10 @@ namespace dbaui void initializeEmbeddedDBList(); protected: - DECL_LINK( OnEmbeddedDBTypeSelected, ListBox* ); + DECL_LINK_TYPED( OnEmbeddedDBTypeSelected, ListBox&, void ); DECL_LINK_TYPED( OnCreateDatabaseModeSelected, Button*, void ); DECL_LINK_TYPED( OnSetupModeSelected, Button*, void ); - DECL_LINK( OnDocumentSelected, ListBox* ); + DECL_LINK_TYPED( OnDocumentSelected, ListBox&, void ); DECL_LINK_TYPED( OnOpenDocument, Button*, void ); }; diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 235393ae249c..975b96a4b090 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -406,8 +406,9 @@ namespace dbaui } } - IMPL_LINK( IndexFieldsControl, OnListEntrySelected, ListBox*, _pBox ) + IMPL_LINK( IndexFieldsControl, OnListEntrySelected, void*, p ) { + ListBox* _pBox = static_cast<ListBox*>(p); if (!_pBox->IsTravelSelect() && m_aModifyHdl.IsSet()) m_aModifyHdl.Call(this); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 2a8fedd2607a..6c6edc6964a8 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -130,7 +130,7 @@ namespace dbaui void OParameterDialog::Construct() { - m_pAllParams->SetSelectHdl(LINK(this, OParameterDialog, OnEntrySelected)); + m_pAllParams->SetSelectHdl(LINK(this, OParameterDialog, OnEntryListBoxSelected)); m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocusHdl)); m_pParam->SetModifyHdl(LINK(this, OParameterDialog, OnValueModified)); m_pTravelNext->SetClickHdl(LINK(this, OParameterDialog, OnButtonClicked)); @@ -140,7 +140,7 @@ namespace dbaui if (m_pAllParams->GetEntryCount()) { m_pAllParams->SelectEntryPos(0); - LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams); + OnEntrySelected(); if (m_pAllParams->GetEntryCount() == 1) { @@ -226,7 +226,7 @@ namespace dbaui else if (m_pOKBtn == pButton) { // transfer the current values into the Any - if (LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams) != 0L) + if (OnEntrySelected()) { // there was an error interpreting the current text m_bNeedErrorOnCurrent = true; // we're are out of the complex web :) of direct and indirect calls to OnValueLoseFocus now, @@ -277,7 +277,7 @@ namespace dbaui nNext = (nCurrent + 1) % nCount; m_pAllParams->SelectEntryPos(nNext); - LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams); + OnEntrySelected(); m_bNeedErrorOnCurrent = true; // we're are out of the complex web :) of direct and indirect calls to OnValueLoseFocus now, // so the next time it is called we need an error message, again .... @@ -285,7 +285,12 @@ namespace dbaui } } - IMPL_LINK(OParameterDialog, OnEntrySelected, ListBox*, /*pList*/) + IMPL_LINK_NOARG_TYPED(OParameterDialog, OnEntryListBoxSelected, ListBox&, void) + { + OnEntrySelected(); + } + + bool OParameterDialog::OnEntrySelected() { if (m_aResetVisitFlag.IsActive()) { @@ -299,7 +304,7 @@ namespace dbaui if (OnValueLoseFocus()) { // there was an error interpreting the text m_pAllParams->SelectEntryPos(m_nCurrentlySelected); - return 1L; + return true; } m_aFinalValues[m_nCurrentlySelected].Value <<= OUString(m_pParam->GetText()); @@ -319,7 +324,7 @@ namespace dbaui m_aResetVisitFlag.SetTimeout(1000); m_aResetVisitFlag.Start(); - return 0L; + return false; } IMPL_LINK_NOARG_TYPED(OParameterDialog, OnVisitedTimeout, Timer*, void) diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 764ce8ff2042..46cab6256d30 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -551,7 +551,7 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,bool _b sName = _rItem.Name; // select the appropriate field name SelectField( *pColumnListControl, sName ); - ListSelectHdl( pColumnListControl ); + ListSelectHdl( *pColumnListControl ); // select the appropriate condition pPredicateListControl->SelectEntryPos( GetSelectionPos( (sal_Int32)_rItem.Handle, *pPredicateListControl ) ); @@ -681,16 +681,16 @@ void DlgFilterCrit::EnableLines() m_pET_WHEREVALUE3->Disable(); } -IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( DlgFilterCrit, ListSelectHdl, ListBox&, rListBox, void ) { OUString aName; ListBox* pComp; - if(pListBox == m_pLB_WHEREFIELD1) + if(&rListBox == m_pLB_WHEREFIELD1) { aName = LbText(*m_pLB_WHEREFIELD1); pComp = m_pLB_WHERECOMP1; } - else if(pListBox == m_pLB_WHEREFIELD2) + else if(&rListBox == m_pLB_WHEREFIELD2) { aName = LbText(*m_pLB_WHEREFIELD2); pComp = m_pLB_WHERECOMP2; @@ -736,13 +736,11 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) pComp->SelectEntryPos(0); EnableLines(); - return 0; } -IMPL_LINK( DlgFilterCrit, ListSelectCompHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( DlgFilterCrit, ListSelectCompHdl, ListBox&, void ) { EnableLines(); - return 0; } void DlgFilterCrit::BuildWherePart() diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index d04714332942..9d7ff34d15c9 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -143,10 +143,9 @@ void DlgOrderCrit::dispose() ModalDialog::dispose(); } -IMPL_LINK( DlgOrderCrit, FieldListSelectHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( DlgOrderCrit, FieldListSelectHdl, ListBox&, void ) { EnableLines(); - return 0; } void DlgOrderCrit::impl_initializeOrderList_nothrow() |