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 /cui | |
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 'cui')
80 files changed, 500 insertions, 534 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d70b472df7cb..c6f363c12eee 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1870,15 +1870,12 @@ bool SvxConfigPage::FillItemSet( SfxItemSet* ) return result; } -IMPL_LINK( SvxConfigPage, SelectSaveInLocation, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxConfigPage, SelectSaveInLocation, ListBox&, void ) { - (void)pBox; - pCurrentSaveInData = static_cast<SaveInData*>(m_pSaveInListBox->GetEntryData( m_pSaveInListBox->GetSelectEntryPos())); Init(); - return 1; } void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) @@ -1916,7 +1913,7 @@ void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) nSelectionPos : m_pTopLevelListBox->GetEntryCount() - 1; m_pTopLevelListBox->SelectEntryPos( nSelectionPos ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); } void SvxConfigPage::AddSubMenusToUI( @@ -2254,7 +2251,7 @@ void SvxMenuConfigPage::Init() ReloadTopLevelListBox(); m_pTopLevelListBox->SelectEntryPos(0); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); } void SvxMenuConfigPage::dispose() @@ -2388,10 +2385,8 @@ short SvxMenuConfigPage::QueryReset() return qbox->Execute(); } -IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxMenuConfigPage, SelectMenu, ListBox&, void ) { - (void)pBox; - m_pContentsListBox->Clear(); SvxConfigEntry* pMenuData = GetTopLevelSelection(); @@ -2414,8 +2409,6 @@ IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox ) } UpdateButtonStates(); - - return 0; } IMPL_LINK_TYPED( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton, void ) @@ -2969,7 +2962,7 @@ void SvxToolbarConfigPage::DeleteSelectedTopLevel() { m_pTopLevelListBox->SelectEntryPos( nSelectionPos - 1 ); } - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); // and now remove the entry m_pTopLevelListBox->RemoveEntry( nSelectionPos ); @@ -3099,7 +3092,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pSaveInData_->RestoreToolbar( pToolbar ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); } break; @@ -3109,7 +3102,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 0 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 0 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3118,7 +3111,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 1 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 1 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3127,7 +3120,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 2 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 2 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3439,7 +3432,7 @@ void SvxToolbarConfigPage::Init() } m_pTopLevelListBox->SelectEntryPos(nPos); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); } SaveInData* SvxToolbarConfigPage::CreateSaveInData( @@ -4319,10 +4312,8 @@ short SvxToolbarConfigPage::QueryReset() return qbox->Execute(); } -IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, SelectToolbar, ListBox&, void ) { - (void)pBox; - m_pContentsListBox->Clear(); SvxConfigEntry* pToolbar = GetTopLevelSelection(); @@ -4332,7 +4323,7 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) m_pModifyCommandButton->Enable( false ); m_pAddCommandsButton->Enable( false ); - return 0; + return; } m_pModifyTopLevelButton->Enable( true ); @@ -4389,8 +4380,6 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) } UpdateButtonStates(); - - return 0; } IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) @@ -4431,7 +4420,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) if ( GetSaveInData() != pData ) { m_pSaveInListBox->SelectEntryPos( nInsertPos ); - m_pSaveInListBox->GetSelectHdl().Call(this); + m_pSaveInListBox->GetSelectHdl().Call(*m_pSaveInListBox); } SvxConfigEntry* pToolbar = @@ -4445,7 +4434,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) nInsertPos = m_pTopLevelListBox->InsertEntry( pToolbar->GetName() ); m_pTopLevelListBox->SetEntryData( nInsertPos, pToolbar ); m_pTopLevelListBox->SelectEntryPos( nInsertPos ); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); pData->SetModified(); } diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 347d1ab8e600..ae2ef79d2bd0 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -97,7 +97,7 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra InitAndSetHandler( m_xAppEvents, m_xDocumentEvents, m_xDocumentModifiable ); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pSaveInListBox ); } SvxEventConfigPage::~SvxEventConfigPage() @@ -167,10 +167,8 @@ void SvxEventConfigPage::ImplInitDocument() } } -IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxEventConfigPage, SelectHdl_Impl, ListBox&, void ) { - (void)pBox; - bool* bApp = static_cast<bool*>(m_pSaveInListBox->GetEntryData( m_pSaveInListBox->GetSelectEntryPos())); @@ -209,7 +207,6 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) } mpImpl->pEventLB->SetUpdateMode( true ); - return sal_IntPtr(true); } bool SvxEventConfigPage::FillItemSet( SfxItemSet* rSet ) diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx index e3b25e6dffbe..c1f283f52b57 100644 --- a/cui/source/customize/eventdlg.hxx +++ b/cui/source/customize/eventdlg.hxx @@ -37,7 +37,7 @@ class SvxEventConfigPage : public _SvxMacroTabPage bool bAppConfig; - DECL_LINK( SelectHdl_Impl, ListBox* ); + DECL_LINK_TYPED( SelectHdl_Impl, ListBox&, void ); SvxEventConfigPage (const SvxEventConfigPage &) SAL_DELETED_FUNCTION; SvxEventConfigPage & operator= (const SvxEventConfigPage &) SAL_DELETED_FUNCTION; diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 02034c5f1763..a64911f25e7a 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -783,7 +783,7 @@ LanguageType SpellDialog::GetSelectedLang_Impl() const } -IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) +IMPL_LINK_TYPED(SpellDialog, LanguageSelectHdl, ListBox&, rBox, void) { //If selected language changes, then add->list should be regenerated to //match @@ -795,7 +795,7 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) m_pSuggestionLB->Clear(); if(!sError.isEmpty()) { - LanguageType eLanguage = pBox->GetSelectLanguage(); + LanguageType eLanguage = static_cast<SvxLanguageBox*>(&rBox)->GetSelectLanguage(); Reference <XSpellAlternatives> xAlt = xSpell->spell( sError, eLanguage, Sequence< PropertyValue >() ); if( xAlt.is() ) @@ -809,7 +809,6 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) m_pSentenceED->AddUndoAction(new SpellUndoAction_Impl(SPELLUNDO_CHANGE_LANGUAGE, aDialogUndoLink)); } SpellDialog::UpdateBoxes_Impl(); - return 0; } diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index fd605cddbdde..6d83d5536a66 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -359,7 +359,7 @@ void SvxCharacterMap::init() m_pFontLB->SelectEntry( aDefStr ); else if ( m_pFontLB->GetEntryCount() ) m_pFontLB->SelectEntryPos(0); - FontSelectHdl(m_pFontLB); + FontSelectHdl(*m_pFontLB); m_pOKBtn->SetClickHdl( LINK( this, SvxCharacterMap, OKHdl ) ); m_pFontLB->SetSelectHdl( LINK( this, SvxCharacterMap, FontSelectHdl ) ); @@ -388,7 +388,7 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont ) m_pFontLB->SelectEntry( aTmp.GetName() ); aFont = aTmp; - FontSelectHdl(m_pFontLB); + FontSelectHdl(*m_pFontLB); // for compatibility reasons ModalDialog::SetFont( aFont ); @@ -424,7 +424,7 @@ void SvxCharacterMap::fillAllSubsets(ListBox &rListBox) -IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) +IMPL_LINK_NOARG_TYPED(SvxCharacterMap, FontSelectHdl, ListBox&, void) { const sal_Int32 nPos = m_pFontLB->GetSelectEntryPos(); const sal_uInt16 nFont = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFontLB->GetEntryData( nPos )); @@ -473,13 +473,11 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) m_pSubsetText->Enable(bNeedSubset); m_pSubsetLB->Enable(bNeedSubset); - - return 0; } -IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl) +IMPL_LINK_NOARG_TYPED(SvxCharacterMap, SubsetSelectHdl, ListBox&, void) { const sal_Int32 nPos = m_pSubsetLB->GetSelectEntryPos(); const Subset* pSubset = static_cast<const Subset*> (m_pSubsetLB->GetEntryData(nPos)); @@ -489,7 +487,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl) m_pShowSet->SelectCharacter( cFirst ); } m_pSubsetLB->SelectEntryPos( nPos ); - return 0; } diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index cf5b2d1983fb..e5fd633788f3 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -409,19 +409,16 @@ IMPL_LINK_NOARG_TYPED(FmSearchDialog, OnFocusGrabbed, Control&, void) m_pcmbSearchText->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); } -IMPL_LINK(FmSearchDialog, OnPositionSelected, ListBox*, pBox) +IMPL_LINK_TYPED(FmSearchDialog, OnPositionSelected, ListBox&, rBox, void) { - (void) pBox; // avoid warning - DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnMethodSelected : unerwartet : nicht genau ein Eintrag selektiert !"); + DBG_ASSERT(rBox.GetSelectEntryCount() == 1, "FmSearchDialog::OnMethodSelected : unerwartet : nicht genau ein Eintrag selektiert !"); m_pSearchEngine->SetPosition(m_plbPosition->GetSelectEntryPos()); - return 0; } -IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox) +IMPL_LINK_TYPED(FmSearchDialog, OnFieldSelected, ListBox&, rBox, void) { - (void) pBox; // avoid warning - DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnFieldSelected : unerwartet : nicht genau ein Eintrag selektiert !"); + DBG_ASSERT(rBox.GetSelectEntryCount() == 1, "FmSearchDialog::OnFieldSelected : unerwartet : nicht genau ein Eintrag selektiert !"); m_pSearchEngine->RebuildUsedFields(m_prbAllFields->IsChecked() ? -1 : (sal_Int16)m_plbField->GetSelectEntryPos()); // calls m_pSearchEngine->InvalidatePreviousLoc too @@ -429,7 +426,6 @@ IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox) sal_Int32 nCurrentContext = m_plbForm->GetSelectEntryPos(); if (nCurrentContext != LISTBOX_ENTRY_NOTFOUND) m_arrContextFields[nCurrentContext] = OUString(m_plbField->GetSelectEntry()); - return 0; } IMPL_LINK_TYPED(FmSearchDialog, OnCheckBoxToggled, CheckBox&, rBox, void) @@ -557,10 +553,9 @@ void FmSearchDialog::InitContext(sal_Int16 nContext) m_pftRecord->SetText(OUString::number(fmscContext.xCursor->getRow())); } -IMPL_LINK( FmSearchDialog, OnContextSelection, ListBox*, pBox) +IMPL_LINK_TYPED( FmSearchDialog, OnContextSelection, ListBox&, rBox, void) { - InitContext(pBox->GetSelectEntryPos()); - return 0L; + InitContext(rBox.GetSelectEntryPos()); } void FmSearchDialog::EnableSearchUI(bool bEnable) @@ -776,7 +771,7 @@ void FmSearchDialog::LoadParams() if (nInitialField == LISTBOX_ENTRY_NOTFOUND) nInitialField = 0; m_plbField->SelectEntryPos(nInitialField); - LINK(this, FmSearchDialog, OnFieldSelected).Call(m_plbField); + LINK(this, FmSearchDialog, OnFieldSelected).Call(*m_plbField); // all fields/single field (AFTER selecting the field because OnClickedFieldRadios expects a valid value there) if (aParams.bAllFields) { @@ -793,7 +788,7 @@ void FmSearchDialog::LoadParams() } m_plbPosition->SelectEntryPos(aParams.nPosition); - LINK(this, FmSearchDialog, OnPositionSelected).Call(m_plbPosition); + LINK(this, FmSearchDialog, OnPositionSelected).Call(*m_plbPosition); // field formatting/case sensitivity/direction m_pcbUseFormat->Check(aParams.bUseFormatter); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index bb703c2eb248..f820a620f94a 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -420,7 +420,7 @@ IMPL_LINK_NOARG_TYPED(TakeProgress, CleanUpHdl, void*, void) aRemainingVector.clear(); mpBrowser->m_pLbxFound->SetUpdateMode( true ); - mpBrowser->SelectFoundHdl( NULL ); + mpBrowser->SelectFoundHdl( *mpBrowser->m_pLbxFound ); GetParent()->LeaveWait(); EndDialog( RET_OK ); @@ -1172,7 +1172,7 @@ IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, ClickTakeAllHdl, Button*, void) -IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFoundHdl) +IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, SelectFoundHdl, ListBox&, void) { if( bInputAllowed ) { @@ -1199,8 +1199,6 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFoundHdl) if( bPreviewPossible && m_pCbxPreview->IsChecked() ) aPreviewTimer.Start(); } - - return 0; } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 727042d530fb..92281b85932c 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -370,7 +370,7 @@ namespace svx , m_bInSelectionUpdate( false ) { m_aValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionValueSetHdl ) ); - m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) ); + m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionListBoxHdl ) ); m_aValueSet->SetLineCount( LINE_CNT ); m_aValueSet->SetStyle( m_aValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL ); @@ -483,10 +483,14 @@ namespace svx { SelectSuggestionHdl(pControl); } - IMPL_LINK( SuggestionDisplay, SelectSuggestionHdl, Control*, pControl ) + IMPL_LINK_TYPED( SuggestionDisplay, SelectSuggestionListBoxHdl, ListBox&, rControl, void ) + { + SelectSuggestionHdl(&rControl); + } + void SuggestionDisplay::SelectSuggestionHdl( Control* pControl ) { if( m_bInSelectionUpdate ) - return 0L; + return; m_bInSelectionUpdate = true; if( pControl == m_aListBox.get() ) @@ -501,7 +505,6 @@ namespace svx } m_bInSelectionUpdate = false; m_aSelectLink.Call( *this ); - return 0L; } void SuggestionDisplay::SetSelectHdl( const Link<SuggestionDisplay&,void>& rLink ) @@ -1535,10 +1538,9 @@ namespace svx return 0; } - IMPL_LINK_NOARG( HangulHanjaEditDictDialog, BookLBSelectHdl ) + IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, BookLBSelectHdl, ListBox&, void ) { InitEditDictDialog( m_aBookLB->GetSelectEntryPos() ); - return 0; } IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, NewPBPushHdl, Button*, void ) diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index d04fd57402c8..dc7300f12d36 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -48,13 +48,12 @@ IMPL_LINK_NOARG_TYPED(SvxMultiPathDialog, SelectHdl_Impl, SvTreeListBox*, void) m_pDelBtn->Enable(bEnable && bIsSelected); } -IMPL_LINK_NOARG(SvxPathSelectDialog, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, SelectHdl_Impl, ListBox&, void) { sal_uLong nCount = m_pPathLB->GetEntryCount(); bool bIsSelected = m_pPathLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; bool bEnable = nCount > 1; m_pDelBtn->Enable(bEnable && bIsSelected); - return 0; } IMPL_LINK_TYPED( SvxMultiPathDialog, CheckHdl_Impl, SvTreeListBox*, pBox, void ) @@ -125,7 +124,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, AddHdl_Impl, Button*, void) m_pPathLB->SetEntryData( nPos, new OUString( aURL ) ); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } } @@ -170,7 +169,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, DelHdl_Impl, Button*, void) m_pPathLB->SelectEntryPos( nPos ); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent) @@ -216,7 +215,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent) m_pAddBtn->SetClickHdl( LINK( this, SvxPathSelectDialog, AddHdl_Impl ) ); m_pDelBtn->SetClickHdl( LINK( this, SvxPathSelectDialog, DelHdl_Impl ) ); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } SvxMultiPathDialog::~SvxMultiPathDialog() @@ -354,7 +353,7 @@ void SvxPathSelectDialog::SetPath(const OUString& rPath) while (nIndex >= 0); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index afec285c61f6..b6f3013f1046 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -69,17 +69,14 @@ void SvPasteObjectDialog::SelectObject() if (m_pLbInsertList->GetEntryCount()) { m_pLbInsertList->SelectEntryPos(0); - SelectHdl(m_pLbInsertList); + SelectHdl(*m_pLbInsertList); } } -IMPL_LINK( SvPasteObjectDialog, SelectHdl, ListBox *, pListBox ) +IMPL_LINK_NOARG_TYPED( SvPasteObjectDialog, SelectHdl, ListBox&, void ) { - (void)pListBox; - if ( !m_pOKButton->IsEnabled() ) m_pOKButton->Enable(); - return 0; } IMPL_LINK_NOARG_TYPED( SvPasteObjectDialog, DoubleClickHdl, ListBox&, void ) diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 4842aff3137e..495d46fd6f81 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -351,16 +351,15 @@ IMPL_LINK_TYPED( SvxThesaurusDialog, LeftBtnHdl_Impl, Button *, pBtn, void ) } } -IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, ListBox*, pLB ) +IMPL_LINK_TYPED( SvxThesaurusDialog, LanguageHdl_Impl, ListBox&, rLB, void ) { - OUString aLangText( pLB->GetSelectEntry() ); + OUString aLangText( rLB.GetSelectEntry() ); LanguageType nLang = SvtLanguageTable::GetLanguageType( aLangText ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); if (xThesaurus->hasLocale( LanguageTag::convertToLocale( nLang ) )) nLookUpLanguage = nLang; SetWindowTitle( nLang ); LookUp_Impl(); - return 0; } void SvxThesaurusDialog::LookUp_Impl() diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 7509de014371..907beeafff60 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -183,7 +183,7 @@ private: DECL_LINK_TYPED(UndoHdl, Button*, void); DECL_LINK_TYPED( AddToDictSelectHdl, MenuButton*, void ); DECL_LINK_TYPED( AddToDictClickHdl, Button*, void ); - DECL_LINK( LanguageSelectHdl, SvxLanguageBox* ); + DECL_LINK_TYPED( LanguageSelectHdl, ListBox&, void ); DECL_LINK_TYPED( DialogUndoHdl, SpellUndoAction_Impl&, void ); DECL_LINK( HandleHyperlink, FixedHyperlink * ); diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx index b520e48bc031..cc43a7366a16 100644 --- a/cui/source/inc/align.hxx +++ b/cui/source/inc/align.hxx @@ -77,7 +77,7 @@ private: bool HasAlignmentChanged( const SfxItemSet& rNew, sal_uInt16 nWhich ) const; - DECL_LINK( UpdateEnableHdl, void* ); + DECL_LINK_TYPED( UpdateEnableHdl, ListBox&, void ); DECL_LINK_TYPED( UpdateEnableClickHdl, Button*, void ); private: diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index eab62485f02a..011063728a50 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -49,7 +49,7 @@ class OfaAutoCorrDlg : public SfxTabDialog sal_uInt16 m_nReplacePageId; sal_uInt16 m_nExceptionsPageId; - DECL_LINK(SelectLanguageHdl, ListBox*); + DECL_LINK_TYPED(SelectLanguageHdl, ListBox&, void); public: OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet *pSet); @@ -317,7 +317,7 @@ private: DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, AutoCorrEdit&, bool); - DECL_LINK(SelectHdl, ListBox*); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK(ModifyHdl, Edit*); bool NewDelHdl(void*); /// Box filled with new language diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 3e2ca3da014e..b42cc67acfff 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -133,12 +133,12 @@ private: void ResetFromWallpaperItem( const SfxItemSet& rSet ); DECL_LINK_TYPED( LoadIdleHdl_Impl, Idle*, void ); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED(BrowseHdl_Impl, Button*, void); DECL_LINK_TYPED( RadioClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( FileClickHdl_Impl, Button*, void ); DECL_LINK_TYPED(BackgroundColorHdl_Impl, ValueSet*, void); - DECL_LINK( TblDestinationHdl_Impl, ListBox* ); + DECL_LINK_TYPED( TblDestinationHdl_Impl, ListBox&, void ); }; #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 3192d51df651..245d5bc24a50 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -117,8 +117,8 @@ private: std::set<sal_Int16> maUsedBorderStyles; // Handler - DECL_LINK( SelStyleHdl_Impl, ListBox* ); - DECL_LINK( SelColHdl_Impl, ListBox* ); + DECL_LINK_TYPED( SelStyleHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( SelColHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SelPreHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( SelSdwHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( LinesChanged_Impl, LinkParamNone*, void ); diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index ff59cf4648cf..c23e1f0af162 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -326,7 +326,7 @@ private: bool bInitialised; SaveInData* pCurrentSaveInData; - DECL_LINK( SelectSaveInLocation, ListBox * ); + DECL_LINK_TYPED( SelectSaveInLocation, ListBox&, void ); DECL_LINK_TYPED( AsyncInfoMsg, void*, void ); protected: @@ -440,7 +440,7 @@ class SvxMenuConfigPage : public SvxConfigPage { private: - DECL_LINK( SelectMenu, ListBox * ); + DECL_LINK_TYPED( SelectMenu, ListBox&, void ); DECL_LINK_TYPED( SelectMenuEntry, SvTreeListBox *, void ); DECL_LINK_TYPED( NewMenuHdl, Button *, void ); DECL_LINK_TYPED( MenuSelectHdl, MenuButton *, void ); @@ -532,7 +532,7 @@ class SvxToolbarConfigPage : public SvxConfigPage { private: - DECL_LINK( SelectToolbar, ListBox * ); + DECL_LINK_TYPED( SelectToolbar, ListBox&, void ); DECL_LINK_TYPED( SelectToolbarEntry, SvTreeListBox*, void ); DECL_LINK_TYPED( ToolbarSelectHdl, MenuButton *, void ); DECL_LINK_TYPED( EntrySelectHdl, MenuButton *, void ); diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx index f750d0eda0b9..b2415cfde7d4 100644 --- a/cui/source/inc/chardlg.hxx +++ b/cui/source/inc/chardlg.hxx @@ -134,6 +134,7 @@ private: DECL_LINK_TYPED(UpdateHdl_Impl, Idle *, void); DECL_LINK( FontModifyHdl_Impl, void* ); + DECL_LINK_TYPED(FontModifyListBoxHdl_Impl, ListBox&, void); public: using SfxTabPage::ActivatePage; @@ -215,11 +216,12 @@ private: void ResetColor_Impl( const SfxItemSet& rSet ); bool FillItemSetColor_Impl( SfxItemSet& rSet ); - DECL_LINK( SelectHdl_Impl, ListBox* ); + void SelectHdl_Impl(ListBox*); + DECL_LINK_TYPED(SelectListBoxHdl_Impl, ListBox&, void); DECL_LINK_TYPED(CbClickHdl_Impl, Button*, void); DECL_LINK_TYPED(TristClickHdl_Impl, Button*, void); - DECL_LINK(UpdatePreview_Impl, void *); - DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* ); + DECL_LINK_TYPED(UpdatePreview_Impl, ListBox&, void); + DECL_LINK_TYPED(ColorBoxSelectHdl_Impl, ListBox&, void); public: virtual ~SvxCharEffectsPage(); @@ -297,7 +299,7 @@ private: DECL_LINK( FontModifyHdl_Impl, void *); DECL_LINK_TYPED( AutoPositionHdl_Impl, Button*, void ); DECL_LINK_TYPED( FitToLineHdl_Impl, Button*, void ); - DECL_LINK( KerningSelectHdl_Impl, void *); + DECL_LINK_TYPED( KerningSelectHdl_Impl, ListBox&, void); DECL_LINK( KerningModifyHdl_Impl, void *); DECL_LINK_TYPED( LoseFocusHdl_Impl, Control&, void ); DECL_LINK( ScaleWidthModifyHdl_Impl, void *); @@ -348,7 +350,7 @@ private: void SetBracket( sal_Unicode cBracket, bool bStart ); DECL_LINK_TYPED(TwoLinesHdl_Impl, Button*, void); - DECL_LINK( CharacterMapHdl_Impl, ListBox* ); + DECL_LINK_TYPED(CharacterMapHdl_Impl, ListBox&, void ); public: virtual ~SvxCharTwoLinesPage(); diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index 875ff89baf9b..e02333a01197 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -58,6 +58,7 @@ private: void FillTypeLB(); DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); public: diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx index c3967d23e5de..f5708e4b00f9 100644 --- a/cui/source/inc/cuicharmap.hxx +++ b/cui/source/inc/cuicharmap.hxx @@ -82,8 +82,8 @@ private: const SubsetMap* pSubsetMap; DECL_LINK_TYPED(OKHdl, Button*, void); - DECL_LINK(FontSelectHdl, void *); - DECL_LINK(SubsetSelectHdl, void *); + DECL_LINK_TYPED(FontSelectHdl, ListBox&, void); + DECL_LINK_TYPED(SubsetSelectHdl, ListBox&, void); DECL_LINK_TYPED(CharDoubleClickHdl, SvxShowCharSet*,void); DECL_LINK_TYPED(CharSelectHdl, SvxShowCharSet*, void); DECL_LINK_TYPED(CharHighlightHdl, SvxShowCharSet*, void); diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx index eb304a7850ba..e202360e677e 100644 --- a/cui/source/inc/cuifmsearch.hxx +++ b/cui/source/inc/cuifmsearch.hxx @@ -163,13 +163,13 @@ private: DECL_LINK(OnSearchTextModified, void *); - DECL_LINK( OnPositionSelected, ListBox* ); - DECL_LINK( OnFieldSelected, ListBox* ); + DECL_LINK_TYPED( OnPositionSelected, ListBox&, void ); + DECL_LINK_TYPED( OnFieldSelected, ListBox&, void ); DECL_LINK_TYPED( OnFocusGrabbed, Control&, void ); DECL_LINK_TYPED( OnCheckBoxToggled, CheckBox&, void ); - DECL_LINK( OnContextSelection, ListBox* ); + DECL_LINK_TYPED( OnContextSelection, ListBox&, void ); DECL_LINK_TYPED( OnSearchProgress, const FmSearchProgress*, void ); @@ -184,7 +184,7 @@ inline void FmSearchDialog::SetActiveField(const OUString& strField) if (nInitialField == LISTBOX_ENTRY_NOTFOUND) nInitialField = 0; m_plbField->SelectEntryPos(nInitialField); - LINK(this, FmSearchDialog, OnFieldSelected).Call(m_plbField); + LINK(this, FmSearchDialog, OnFieldSelected).Call(*m_plbField); } #endif // INCLUDED_CUI_SOURCE_INC_CUIFMSEARCH_HXX diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx index 2ab6b08e6c04..645c6a973319 100644 --- a/cui/source/inc/cuigaldlg.hxx +++ b/cui/source/inc/cuigaldlg.hxx @@ -282,7 +282,7 @@ class TPGalleryThemeProperties : public SfxTabPage DECL_LINK_TYPED( ClickSearchHdl, Button*, void ); DECL_LINK_TYPED( ClickTakeHdl, Button*, void ); DECL_LINK_TYPED( ClickTakeAllHdl, Button*, void ); - DECL_LINK( SelectFoundHdl, void* ); + DECL_LINK_TYPED( SelectFoundHdl, ListBox&, void ); DECL_LINK( SelectFileTypeHdl, void* ); DECL_LINK_TYPED( DClickFoundHdl, ListBox&, void ); DECL_LINK_TYPED( PreviewTimerHdl, Timer*, void ); diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 4514c2903ab9..e09587c38d49 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -145,6 +145,7 @@ class SvxTransparenceTabPage : public SvxTabPage DECL_LINK_TYPED(ClickTransGradientHdl_Impl, Button*, void ); DECL_LINK(ModifyTransparentHdl_Impl, void*); DECL_LINK(ModifiedTrgrHdl_Impl, void*); + DECL_LINK_TYPED(ModifiedTrgrListBoxHdl_Impl, ListBox&, void); void ActivateLinear(bool bActivate); void ActivateGradient(bool bActivate); @@ -263,13 +264,13 @@ private: OUString maDirectName; VclPtr<PushButton> m_pBtnImport; - DECL_LINK(SelectDialogTypeHdl_Impl, void *); - DECL_LINK( ModifyColorHdl_Impl, void * ); - DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * ); - DECL_LINK( ModifyGradientHdl_Impl, void * ); - DECL_LINK( ModifyHatchingHdl_Impl, void * ); + DECL_LINK_TYPED(SelectDialogTypeHdl_Impl, ListBox&, void); + DECL_LINK_TYPED( ModifyColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyHatchBckgrdColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyGradientHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyHatchingHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ToggleHatchBckgrdColorHdl_Impl, CheckBox&, void ); - DECL_LINK( ModifyBitmapHdl_Impl, void * ); + DECL_LINK_TYPED( ModifyBitmapHdl_Impl, ListBox&, void ); DECL_LINK( ModifyStepCountHdl_Impl, void* ); DECL_LINK_TYPED( ModifyStepCountClickHdl_Impl, Button*, void ); @@ -353,6 +354,7 @@ private: DECL_LINK_TYPED( ClickShadowHdl_Impl, Button*, void ); DECL_LINK( ModifyShadowHdl_Impl, void * ); + DECL_LINK_TYPED( SelectShadowHdl_Impl, ListBox&, void ); public: SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); @@ -425,8 +427,9 @@ private: DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( ChangeGradientHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeGradientHdl_Impl, ListBox&, void ); DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); @@ -500,8 +503,9 @@ private: SfxMapUnit m_ePoolUnit; - DECL_LINK( ChangeHatchHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeHatchHdl_Impl, ListBox&, void ); DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); @@ -588,9 +592,9 @@ private: DECL_LINK_TYPED( ClickImportHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( ChangeBitmapHdl_Impl, void * ); - DECL_LINK( ChangePixelColorHdl_Impl, void * ); - DECL_LINK( ChangeBackgrndColorHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeBitmapHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangePixelColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangeBackgrndColorHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); @@ -721,9 +725,9 @@ private: DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickWorkOnHdl_Impl, Button*, void ); - DECL_LINK( SelectColorLBHdl_Impl, void * ); + DECL_LINK_TYPED( SelectColorLBHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SelectValSetHdl_Impl, ValueSet*, void ); - DECL_LINK( SelectColorModelHdl_Impl, void * ); + DECL_LINK_TYPED( SelectColorModelHdl_Impl, ListBox&, void ); void ChangeColor(const Color &rNewColor); DECL_LINK( ModifiedHdl_Impl, void * ); diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index d9126586d850..b1dcf0a04e0c 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -176,18 +176,24 @@ private: DECL_LINK( SizeHdl_Impl, MetricField * ); DECL_LINK_TYPED( RatioHdl_Impl, Button*, void ); - DECL_LINK( ClickInvisibleHdl_Impl, void * ); - DECL_LINK( ChangeStartHdl_Impl, void * ); + DECL_LINK_TYPED( ClickInvisibleHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeStartClickHdl_Impl, Button*, void ); - DECL_LINK( ChangeEndHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeStartListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangeStartModifyHdl_Impl, void * ); + void ChangeStartHdl_Impl(void*); + DECL_LINK_TYPED( ChangeEndListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangeEndModifyHdl_Impl, void * ); DECL_LINK_TYPED( ChangeEndClickHdl_Impl, Button*, void ); - DECL_LINK( ChangePreviewHdl_Impl, void * ); + void ChangeEndHdl_Impl(void*); + DECL_LINK_TYPED( ChangePreviewListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangePreviewModifyHdl_Impl, void* ); + void ChangePreviewHdl_Impl(void*); DECL_LINK( ChangeTransparentHdl_Impl, void * ); - DECL_LINK( ChangeEdgeStyleHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeEdgeStyleHdl_Impl, ListBox&, void ); - // LineCaps - DECL_LINK ( ChangeCapStyleHdl_Impl, void * ); + // LineCaps + DECL_LINK_TYPED( ChangeCapStyleHdl_Impl, ListBox&, void ); bool FillXLSet_Impl(); @@ -285,14 +291,16 @@ private: DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( SelectLinestyleHdl_Impl, void * ); + DECL_LINK_TYPED( SelectLinestyleListBoxHdl_Impl, ListBox&, void ); + void SelectLinestyleHdl_Impl(ListBox*); DECL_LINK( ChangePreviewHdl_Impl, void * ); DECL_LINK( ChangeNumber1Hdl_Impl, void * ); DECL_LINK( ChangeNumber2Hdl_Impl, void * ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); DECL_LINK_TYPED( ChangeMetricHdl_Impl, Button*, void ); - DECL_LINK( SelectTypeHdl_Impl, void * ); + DECL_LINK_TYPED( SelectTypeListBoxHdl_Impl, ListBox&, void ); + void SelectTypeHdl_Impl(ListBox*); void CheckChanges_Impl(); @@ -361,7 +369,7 @@ private: DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); - DECL_LINK( SelectLineEndHdl_Impl, void * ); + DECL_LINK_TYPED( SelectLineEndHdl_Impl, ListBox&, void ); long ChangePreviewHdl_Impl( void* p ); void CheckChanges_Impl(); diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx index 42a85b2ac6f0..0151c20358f0 100644 --- a/cui/source/inc/hangulhanjadlg.hxx +++ b/cui/source/inc/hangulhanjadlg.hxx @@ -79,8 +79,9 @@ namespace svx virtual void LoseFocus() SAL_OVERRIDE; virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; - DECL_LINK( SelectSuggestionHdl, Control* ); + DECL_LINK_TYPED( SelectSuggestionListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( SelectSuggestionValueSetHdl, ValueSet*, void ); + void SelectSuggestionHdl(Control*); void SetHelpIds(); @@ -297,7 +298,7 @@ namespace svx DECL_LINK( EditModifyHdl3, Edit* ); DECL_LINK( EditModifyHdl4, Edit* ); - DECL_LINK( BookLBSelectHdl, void* ); + DECL_LINK_TYPED( BookLBSelectHdl, ListBox&, void ); DECL_LINK_TYPED( NewPBPushHdl, Button*, void ); DECL_LINK_TYPED( DeletePBPushHdl, Button*, void ); diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx index 571559a101d9..03edc7ba1f8c 100644 --- a/cui/source/inc/labdlg.hxx +++ b/cui/source/inc/labdlg.hxx @@ -65,8 +65,8 @@ private: void SetupAnsatz_Impl( sal_uInt16 nType ); void SetupType_Impl( sal_uInt16 nType ); - DECL_LINK( AnsatzSelectHdl_Impl, ListBox * ); - DECL_LINK( AnsatzRelSelectHdl_Impl, ListBox * ); + DECL_LINK_TYPED( AnsatzSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( AnsatzRelSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( LineOptHdl_Impl, Button *, void ); DECL_LINK_TYPED( SelectCaptTypeHdl_Impl, ValueSet*, void ); diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index 81ffca5cb44b..5d68a776fcbc 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -62,6 +62,7 @@ private: DECL_LINK_TYPED( ClickAutoPosHdl_Impl, Button*, void ); DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeAttrClickHdl_Impl, Button*, void ); public: diff --git a/cui/source/inc/multipat.hxx b/cui/source/inc/multipat.hxx index 5415fb23a0ad..f462570a4148 100644 --- a/cui/source/inc/multipat.hxx +++ b/cui/source/inc/multipat.hxx @@ -66,7 +66,7 @@ private: DECL_LINK_TYPED(AddHdl_Impl, Button*, void); DECL_LINK_TYPED(DelHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); public: SvxPathSelectDialog(vcl::Window* pParent); diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 401d399a3a97..2c204799611c 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -153,9 +153,10 @@ private: // Handler DECL_LINK_TYPED( LostFocusHdl_Impl, Control&, void ); DECL_LINK_TYPED( DoubleClickHdl_Impl, SvTreeListBox*, bool ); - DECL_LINK( SelFormatHdl_Impl, void * ); - DECL_LINK_TYPED( SelFormatListBoxHdl_Impl, SvTreeListBox*, void ); + DECL_LINK_TYPED( SelFormatListBoxHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( SelFormatTreeListBoxHdl_Impl, SvTreeListBox*, void ); DECL_LINK_TYPED( SelFormatClickHdl_Impl, Button*, void ); + void SelFormatHdl_Impl(void*); DECL_LINK_TYPED( ClickHdl_Impl, Button*, void ); DECL_LINK( EditHdl_Impl, Edit* ); DECL_LINK( OptHdl_Impl, void * ); diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 5b96a904a21e..67e0445a77ab 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -320,19 +320,20 @@ class SvxNumOptionsTabPage : public SfxTabPage void SwitchNumberType( sal_uInt8 nType, bool bBmp = false ); void CheckForStartValue_Impl(sal_uInt16 nNumberingType); - DECL_LINK( NumberTypeSelectHdl_Impl, ListBox * ); - DECL_LINK( LevelHdl_Impl, ListBox * ); + DECL_LINK_TYPED( NumberTypeSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( LevelHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( PopupActivateHdl_Impl, Menu *, bool); DECL_LINK_TYPED( GraphicHdl_Impl, MenuButton *, void ); DECL_LINK_TYPED( BulletHdl_Impl, Button*, void); DECL_LINK( SizeHdl_Impl, MetricField * ); DECL_LINK_TYPED( RatioHdl_Impl, Button*, void ); - DECL_LINK( CharFmtHdl_Impl, void *); - DECL_LINK( EditModifyHdl_Impl, Edit * ); + DECL_LINK_TYPED( CharFmtHdl_Impl, ListBox&, void ); + DECL_LINK( EditModifyHdl_Impl, Edit* ); + DECL_LINK_TYPED( EditListBoxHdl_Impl, ListBox&, void ); DECL_LINK( AllLevelHdl_Impl, NumericField * ); - DECL_LINK( OrientHdl_Impl, ListBox * ); + DECL_LINK_TYPED( OrientHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SameLevelHdl_Impl, Button*, void ); - DECL_LINK( BulColorHdl_Impl, ColorListBox* ); + DECL_LINK_TYPED( BulColorHdl_Impl, ListBox&, void ); DECL_LINK( BulRelSizeHdl_Impl, MetricField *); DECL_LINK_TYPED( PreviewInvalidateHdl_Impl, Timer *, void); @@ -426,8 +427,8 @@ class SvxNumPositionTabPage : public SfxTabPage void InitControls(); - DECL_LINK( LevelHdl_Impl, ListBox * ); - DECL_LINK( EditModifyHdl_Impl, void *); + DECL_LINK_TYPED( LevelHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( EditModifyHdl_Impl, ListBox&, void); DECL_LINK( DistanceHdl_Impl, MetricField * ); DECL_LINK_TYPED( DistanceFocusHdl_Impl, Control&, void ); DECL_LINK_TYPED( RelativeHdl_Impl, Button*, void ); @@ -436,7 +437,7 @@ class SvxNumPositionTabPage : public SfxTabPage void InitPosAndSpaceMode(); void ShowControlsDependingOnPosAndSpaceMode(); - DECL_LINK(LabelFollowedByHdl_Impl, void *); + DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void); DECL_LINK( ListtabPosHdl_Impl, MetricField* ); DECL_LINK( AlignAtHdl_Impl, MetricField* ); DECL_LINK( IndentAtHdl_Impl, MetricField* ); diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx index 441f311e9919..d88d65927453 100644 --- a/cui/source/inc/optasian.hxx +++ b/cui/source/inc/optasian.hxx @@ -48,7 +48,7 @@ class SvxAsianLayoutPage : public SfxTabPage SvxAsianLayoutPage_Impl* pImpl; - DECL_LINK(LanguageHdl, void *); + DECL_LINK_TYPED(LanguageHdl, ListBox&, void); DECL_LINK_TYPED(ChangeStandardHdl, Button*, void); DECL_LINK(ModifyHdl, Edit*); diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx index fe04cab545cd..d909e8417ca6 100644 --- a/cui/source/inc/optdict.hxx +++ b/cui/source/inc/optdict.hxx @@ -129,8 +129,8 @@ private: bool bDoNothing; bool bDicIsReadonly; - DECL_LINK(SelectBookHdl_Impl, void *); - DECL_LINK(SelectLangHdl_Impl, void *); + DECL_LINK_TYPED(SelectBookHdl_Impl, ListBox&, void); + DECL_LINK_TYPED(SelectLangHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SelectHdl, SvTreeListBox*, void); DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, SvxDictEdit&, bool); diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx index 76726d33728b..906ea8c9f33d 100644 --- a/cui/source/inc/optlingu.hxx +++ b/cui/source/inc/optlingu.hxx @@ -78,10 +78,11 @@ class SvxEditModulesDlg : public ModalDialog DECL_LINK_TYPED(UpDownHdl_Impl, Button*, void); DECL_LINK_TYPED(ClickHdl_Impl, Button*, void); DECL_LINK_TYPED(BackHdl_Impl, Button*, void); - DECL_LINK( LangSelectHdl_Impl, ListBox* ); + DECL_LINK_TYPED( LangSelectListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( BoxCheckButtonHdl_Impl2, SvLBoxButtonData*, void ); DECL_LINK_TYPED( BoxCheckButtonHdl_Impl, SvTreeListBox*, void ); DECL_LINK(OpenURLHdl_Impl, void *); + void LangSelectHdl_Impl(ListBox*); public: SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rData); diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 1d55426a4545..0c5b225301dc 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -149,7 +149,7 @@ private: bool mbEnableDrawingLayerFillStyles : 1; void Init_Impl(); - DECL_LINK( LayoutHdl_Impl, void *); + DECL_LINK_TYPED( LayoutHdl_Impl, ListBox&, void); DECL_LINK_TYPED( PaperBinHdl_Impl, Control&, void); DECL_LINK_TYPED( SwapOrientation_Impl, Button*, void ); void SwapFirstValues_Impl( bool bSet ); @@ -158,10 +158,10 @@ private: DECL_LINK_TYPED( CenterHdl_Impl, Button*, void); void UpdateExample_Impl( bool bResetbackground = false ); - DECL_LINK( PaperSizeSelect_Impl, ListBox* ); + DECL_LINK_TYPED( PaperSizeSelect_Impl, ListBox&, void ); DECL_LINK( PaperSizeModify_Impl, void *); - DECL_LINK( FrameDirectionModify_Impl, ListBox* ); + DECL_LINK_TYPED( FrameDirectionModify_Impl, ListBox&, void ); void ResetBackground_Impl( const SfxItemSet& rSet ); diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index fdb840c71334..b4b401ea0420 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -90,7 +90,7 @@ private: void Init_Impl(); void UpdateExample_Impl(); - DECL_LINK( LineDistHdl_Impl, ListBox* ); + DECL_LINK_TYPED( LineDistHdl_Impl, ListBox&, void ); DECL_LINK(ModifyHdl_Impl, void *); DECL_LINK_TYPED( AutoHdl_Impl, Button*, void ); @@ -154,8 +154,8 @@ class SvxParaAlignTabPage : public SfxTabPage VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB; DECL_LINK_TYPED(AlignHdl_Impl, Button*, void); - DECL_LINK(LastLineHdl_Impl, void *); - DECL_LINK(TextDirectionHdl_Impl, void *); + DECL_LINK_TYPED(LastLineHdl_Impl, ListBox&, void); + DECL_LINK_TYPED(TextDirectionHdl_Impl, ListBox&, void); void UpdateExample_Impl(); @@ -262,8 +262,8 @@ private: DECL_LINK_TYPED(OrphanHdl_Impl, Button*, void); DECL_LINK_TYPED(HyphenClickHdl_Impl, Button*, void); DECL_LINK_TYPED(ApplyCollClickHdl_Impl, Button*, void); - DECL_LINK( PageBreakPosHdl_Impl, ListBox* ); - DECL_LINK( PageBreakTypeHdl_Impl, ListBox* ); + DECL_LINK_TYPED( PageBreakPosHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( PageBreakTypeHdl_Impl, ListBox&, void ); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx index 26a439f80402..3d5aa611232e 100644 --- a/cui/source/inc/pastedlg.hxx +++ b/cui/source/inc/pastedlg.hxx @@ -50,7 +50,7 @@ class SvPasteObjectDialog : public ModalDialog FixedText& ObjectSource() { return *m_pFtObjectSource; } void SelectObject(); - DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DoubleClickHdl, ListBox&, void ); public: diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx index 6003fc6c1385..7635ec68dc31 100644 --- a/cui/source/inc/swpossizetabpage.hxx +++ b/cui/source/inc/swpossizetabpage.hxx @@ -103,8 +103,8 @@ class SvxSwPosSizeTabPage : public SfxTabPage DECL_LINK_TYPED(RangeModifyHdl, Control&, void); DECL_LINK_TYPED(RangeModifyClickHdl, Button*, void); DECL_LINK_TYPED(AnchorTypeHdl, Button*, void); - DECL_LINK( PosHdl, ListBox * ); - DECL_LINK( RelHdl, ListBox * ); + DECL_LINK_TYPED( PosHdl, ListBox&, void ); + DECL_LINK_TYPED( RelHdl, ListBox&, void ); DECL_LINK_TYPED(MirrorHdl, Button*, void); DECL_LINK( ModifyHdl, Edit * ); DECL_LINK_TYPED(ProtectHdl, Button*, void); diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index c0a1896bcc4b..725ef2f755e1 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -65,7 +65,7 @@ private: FieldUnit eFUnit; SfxMapUnit eUnit; - DECL_LINK( SelectEffectHdl_Impl, void * ); + DECL_LINK_TYPED( SelectEffectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickEndlessHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickAutoHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickPixelHdl_Impl, Button*, void ); diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx index 26f75237ba50..a598f2e53575 100644 --- a/cui/source/inc/thesdlg.hxx +++ b/cui/source/inc/thesdlg.hxx @@ -144,7 +144,7 @@ public: // Handler DECL_LINK_TYPED( ReplaceBtnHdl_Impl, Button *, void ); DECL_LINK_TYPED( LeftBtnHdl_Impl, Button *, void ); - DECL_LINK( LanguageHdl_Impl, ListBox * ); + DECL_LINK_TYPED( LanguageHdl_Impl, ListBox&, void ); DECL_LINK( WordSelectHdl_Impl, ComboBox * ); DECL_LINK_TYPED( AlternativesSelectHdl_Impl, SvTreeListBox*, void ); DECL_LINK_TYPED( AlternativesDoubleClickHdl_Impl, SvTreeListBox*, bool ); diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 9f2ac0421969..1ccc1ce4af65 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -139,7 +139,7 @@ SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& get(m_pEndED, "end"); get(m_pHintFT, "hintft"); - LanguageHdl(m_pLanguageLB); + LanguageHdl(*m_pLanguageLB); m_pLanguageLB->SetSelectHdl(LINK(this, SvxAsianLayoutPage, LanguageHdl)); m_pStandardCB->SetClickHdl(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl)); Link<> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl)); @@ -310,10 +310,10 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* ) eLastUsedLanguageTypeForForbiddenCharacters = LANGUAGE_CHINESE_TRADITIONAL; } m_pLanguageLB->SelectLanguage( eLastUsedLanguageTypeForForbiddenCharacters ); - LanguageHdl(m_pLanguageLB); + LanguageHdl(*m_pLanguageLB); } -IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl) +IMPL_LINK_NOARG_TYPED(SvxAsianLayoutPage, LanguageHdl, ListBox&, void) { //set current value LanguageType eSelectLanguage = m_pLanguageLB->GetSelectLanguage(); @@ -374,8 +374,6 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl) m_pEndFT->Enable(bAvail); m_pStartED->SetText(sStart); m_pEndED->SetText(sEnd); - - return 0; } IMPL_LINK_TYPED(SvxAsianLayoutPage, ChangeStandardHdl, Button*, pBox, void) diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 9f12dc047dc6..555915e9743d 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -115,7 +115,7 @@ void SvxDefaultColorOptPage::Construct() FillColorBox(); m_pLbChartColors->SelectEntryPos( 0 ); - ListClickedHdl(m_pLbChartColors); + ListClickedHdl(*m_pLbChartColors); } @@ -135,7 +135,7 @@ bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs ) void SvxDefaultColorOptPage::Reset( const SfxItemSet* ) { m_pLbChartColors->SelectEntryPos( 0 ); - ListClickedHdl(m_pLbChartColors); + ListClickedHdl(*m_pLbChartColors); } void SvxDefaultColorOptPage::FillColorBox() @@ -247,9 +247,9 @@ IMPL_LINK_TYPED( SvxDefaultColorOptPage, RemoveChartColor, Button*, pButton, voi } } -IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ColorLB*, _pColorList ) +IMPL_LINK_TYPED( SvxDefaultColorOptPage, ListClickedHdl, ListBox&, _rBox, void ) { - Color aCol = _pColorList->GetSelectEntryColor(); + Color aCol = static_cast<ColorLB&>(_rBox).GetSelectEntryColor(); long nIndex = GetColorIndex( aCol ); @@ -257,8 +257,6 @@ IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ColorLB*, _pColorList ) m_pValSetColorBox->SetNoSelection(); else m_pValSetColorBox->SelectItem( nIndex + 1 ); // ValueSet is 1-based - - return 0L; } IMPL_LINK_NOARG_TYPED(SvxDefaultColorOptPage, BoxClickedHdl, ValueSet*, void) diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx index 8046c1daa42f..bd2d2f013717 100644 --- a/cui/source/options/optchart.hxx +++ b/cui/source/options/optchart.hxx @@ -46,7 +46,7 @@ private: DECL_LINK_TYPED( ResetToDefaults, Button *, void ); DECL_LINK_TYPED( AddChartColor, Button *, void ); DECL_LINK_TYPED( RemoveChartColor, Button *, void ); - DECL_LINK( ListClickedHdl, ColorLB * ); + DECL_LINK_TYPED( ListClickedHdl, ListBox&, void ); DECL_LINK_TYPED(BoxClickedHdl, ValueSet*, void); void FillColorBox(); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index d95fd2a6a0d5..916ea82461c6 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -177,7 +177,7 @@ public: virtual void dispose() SAL_OVERRIDE; public: - void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&); + void SetLinks (Link<Button*,void> const&, Link<ListBox&,void> const&, Link<Control&,void> const&); unsigned GetEntryHeight () const { return vEntries[0]->GetHeight(); } void Update (EditableColorConfig const*, EditableExtendedColorConfig const*); void ScrollHdl(const ScrollBar&); @@ -219,7 +219,7 @@ private: void SetAppearance(Wallpaper const& aTextWall, ColorListBox const& aSampleList); void SetTextColor (Color C) { m_pText->SetTextColor(C); } public: - void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&); + void SetLinks (Link<Button*,void> const&, Link<ListBox&,void> const&, Link<Control&,void> const&); void Update (ColorConfigEntry, ColorConfigValue const&); void Update (ExtendedColorConfigValue const&); void ColorChanged (ColorConfigEntry, ColorConfigValue&); @@ -414,7 +414,7 @@ void ColorConfigWindow_Impl::Entry::SetAppearance( // SetLinks() void ColorConfigWindow_Impl::Entry::SetLinks( - Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, + Link<Button*,void> const& aCheckLink, Link<ListBox&,void> const& aColorLink, Link<Control&,void> const& aGetFocusLink) { m_pColorList->SetSelectHdl(aColorLink); @@ -689,7 +689,7 @@ void ColorConfigWindow_Impl::Init(ScrollBar *pVScroll, HeaderBar *pHeaderHB) // SetLinks() void ColorConfigWindow_Impl::SetLinks ( - Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, Link<Control&,void> const& aGetFocusLink + Link<Button*,void> const& aCheckLink, Link<ListBox&,void> const& aColorLink, Link<Control&,void> const& aGetFocusLink ) { for (unsigned i = 0; i != vEntries.size(); ++i) vEntries[i]->SetLinks(aCheckLink, aColorLink, aGetFocusLink); @@ -846,7 +846,7 @@ class ColorConfigCtrl_Impl : public VclVBox DECL_LINK_TYPED(ScrollHdl, ScrollBar*, void); DECL_LINK_TYPED(ClickHdl, Button*, void); - DECL_LINK(ColorHdl, ColorListBox*); + DECL_LINK_TYPED(ColorHdl, ListBox&, void); DECL_LINK_TYPED(ControlFocusHdl, Control&, void); virtual bool PreNotify (NotifyEvent& rNEvt) SAL_OVERRIDE; @@ -900,7 +900,7 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(vcl::Window* pParent) m_pVScroll->SetEndScrollHdl(aScrollLink); Link<Button*,void> aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl); - Link<> aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl); + Link<ListBox&,void> aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl); Link<Control&,void> aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl); m_pScrollWindow->SetLinks(aCheckLink, aColorLink, aGetFocusLink); @@ -1006,12 +1006,10 @@ IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ClickHdl, Button*, pBox, void) } // a color list has changed -IMPL_LINK(ColorConfigCtrl_Impl, ColorHdl, ColorListBox*, pBox) +IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ColorHdl, ListBox&, rBox, void) { DBG_ASSERT(pColorConfig, "Configuration not set" ); - if (pBox) - m_pScrollWindow->ColorHdl(pColorConfig, pExtColorConfig, pBox); - return 0; + m_pScrollWindow->ColorHdl(pColorConfig, pExtColorConfig, static_cast<ColorListBox*>(&rBox)); } IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ControlFocusHdl, Control&, rCtrl, void) { @@ -1175,12 +1173,11 @@ void SvxColorOptionsTabPage::UpdateColorConfig() m_pColorConfigCT->Update(); } -IMPL_LINK(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox&, rBox, void) { - pColorConfig->LoadScheme(pBox->GetSelectEntry()); - pExtColorConfig->LoadScheme(pBox->GetSelectEntry()); + pColorConfig->LoadScheme(rBox.GetSelectEntry()); + pExtColorConfig->LoadScheme(rBox.GetSelectEntry()); UpdateColorConfig(); - return 0; } IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, void ) @@ -1205,7 +1202,7 @@ IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, vo pExtColorConfig->AddScheme(sName); m_pColorSchemeLB->InsertEntry(sName); m_pColorSchemeLB->SelectEntry(sName); - m_pColorSchemeLB->GetSelectHdl().Call(m_pColorSchemeLB); + m_pColorSchemeLB->GetSelectHdl().Call(*m_pColorSchemeLB); } } else @@ -1218,7 +1215,7 @@ IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, vo OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry()); m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectEntryPos()); m_pColorSchemeLB->SelectEntryPos(0); - m_pColorSchemeLB->GetSelectHdl().Call(m_pColorSchemeLB); + m_pColorSchemeLB->GetSelectHdl().Call(*m_pColorSchemeLB); //first select the new scheme and then delete the old one pColorConfig->DeleteScheme(sDeleteScheme); pExtColorConfig->DeleteScheme(sDeleteScheme); diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx index f182e4bd5d3d..3fa8d3a120a7 100644 --- a/cui/source/options/optcolor.hxx +++ b/cui/source/options/optcolor.hxx @@ -41,7 +41,7 @@ class SvxColorOptionsTabPage : public SfxTabPage svtools::EditableColorConfig* pColorConfig; svtools::EditableExtendedColorConfig* pExtColorConfig; - DECL_LINK(SchemeChangedHdl_Impl, ListBox*); + DECL_LINK_TYPED(SchemeChangedHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SaveDeleteHdl_Impl, Button*, void); DECL_LINK_TYPED(CheckNameHdl_Impl, AbstractSvxNameDialog&, bool); void UpdateColorConfig(); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 802763a5ca2e..28535aaaa1d3 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -433,7 +433,7 @@ void SvxEditDictionaryDialog::RemoveDictEntry(SvTreeListEntry* pEntry) -IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectBookHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxEditDictionaryDialog, SelectBookHdl_Impl, ListBox&, void) { sal_Int32 nPos = pAllDictsLB->GetSelectEntryPos(); @@ -453,12 +453,11 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectBookHdl_Impl) pLangFT->Enable( bEnable ); pLangLB->Enable( bEnable ); } - return 0; } -IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxEditDictionaryDialog, SelectLangHdl_Impl, ListBox&, void) { sal_Int32 nDicPos = pAllDictsLB->GetSelectEntryPos(); sal_Int32 nLang = pLangLB->GetSelectLanguage(); @@ -488,7 +487,6 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) else SetLanguage_Impl( nOldLang ); } - return 1; } diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 79e037c9d467..0764524c0b6d 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1473,7 +1473,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet ) // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support // #i15812# must be done *before* the configured currency is set // and update the decimal separator used for the given locale - LocaleSettingHdl(m_pLocaleSettingLB); + LocaleSettingHdl(*m_pLocaleSettingLB); // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default OUString aAbbrev; @@ -1651,8 +1651,9 @@ namespace } } -IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) +IMPL_LINK_TYPED( OfaLanguagesTabPage, LocaleSettingHdl, ListBox&, rListBox, void ) { + SvxLanguageBox* pBox = static_cast<SvxLanguageBox*>(&rListBox); LanguageType eLang = pBox->GetSelectLanguage(); SvtScriptType nType = SvtLanguageOptions::GetScriptTypeOfLanguage(eLang); // first check if CTL must be enabled @@ -1697,8 +1698,6 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) OUString aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper); m_bDatePatternsValid = true; m_pDatePatternsED->SetText( aDatePatternsString); - - return 0; } IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd ) diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index ae66faa9b637..c2f5fac0e18d 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -160,7 +160,7 @@ class OfaLanguagesTabPage : public SfxTabPage bool m_bDatePatternsValid; DECL_LINK_TYPED( SupportHdl, Button*, void ) ; - DECL_LINK( LocaleSettingHdl, SvxLanguageBox* ) ; + DECL_LINK_TYPED( LocaleSettingHdl, ListBox&, void ) ; DECL_LINK( DatePatternsHdl, Edit* ) ; public: diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 3033918c8751..345468494451 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -525,9 +525,9 @@ void SvxProxyTabPage::EnableControls_Impl(bool bEnable) -IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxProxyTabPage, ProxyHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); // Restore original system values if( nPos == 1 ) @@ -536,7 +536,6 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox ) } EnableControls_Impl(nPos == 2); - return 0; } diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index 32804fb4a9d9..0183f077af0c 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -95,7 +95,7 @@ private: void ReadConfigDefaults_Impl(); void RestoreConfigDefaults_Impl(); - DECL_LINK( ProxyHdl_Impl, ListBox * ); + DECL_LINK_TYPED( ProxyHdl_Impl, ListBox&, void ); DECL_STATIC_LINK_TYPED( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, void ); public: diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 552bd17f2a49..b43d1e90e092 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -861,10 +861,9 @@ IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, AssignHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxJavaParameterDlg, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, SelectHdl_Impl, ListBox&, void) { EnableRemoveButton(); - return 0; } @@ -1066,10 +1065,9 @@ IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, RemoveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxJavaClassPathDlg, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, SelectHdl_Impl, ListBox&, void) { EnableRemoveButton(); - return 0; } @@ -1129,7 +1127,7 @@ void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath ) } // select first entry m_pPathList->SelectEntryPos(0); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathList ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index a139fa27da17..294f5e910db3 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -129,7 +129,7 @@ private: DECL_LINK(ModifyHdl_Impl, void *); DECL_LINK_TYPED(AssignHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); DECL_LINK_TYPED(DblClickHdl_Impl, ListBox&, void); DECL_LINK_TYPED(RemoveHdl_Impl, Button*, void); @@ -165,7 +165,7 @@ private: DECL_LINK_TYPED(AddArchiveHdl_Impl, Button*, void); DECL_LINK_TYPED(AddPathHdl_Impl, Button*, void); DECL_LINK_TYPED(RemoveHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); bool IsPathDuplicate( const OUString& _rPath ); inline void EnableRemoveButton() diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 40b77cb3d6bf..278355608267 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1901,7 +1901,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD if(!m_pLanguageLB->IsLanguageSelected( eSysLang ) ) m_pLanguageLB->SelectEntryPos(0); - m_pLanguageLB->SetSelectHdl( LINK( this, SvxEditModulesDlg, LangSelectHdl_Impl )); + m_pLanguageLB->SetSelectHdl( LINK( this, SvxEditModulesDlg, LangSelectListBoxHdl_Impl )); LangSelectHdl_Impl(m_pLanguageLB); } @@ -2010,7 +2010,12 @@ IMPL_LINK_NOARG_TYPED( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, SvTreeListBox } } -IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxEditModulesDlg, LangSelectListBoxHdl_Impl, ListBox&, rBox, void ) +{ + LangSelectHdl_Impl(&rBox); +} + +void SvxEditModulesDlg::LangSelectHdl_Impl(ListBox* pBox) { LanguageType eCurLanguage = m_pLanguageLB->GetSelectLanguage(); static Locale aLastLocale; @@ -2262,7 +2267,6 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) } } aLastLocale = aCurLocale; - return 0; } IMPL_LINK_TYPED( SvxEditModulesDlg, UpDownHdl_Impl, Button *, pBtn, void ) diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index 22f65cceaf7c..8042509293ce 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -219,7 +219,7 @@ public: VclPtr<Edit> mpDevice; VclPtr<Edit> mpDriverVersion; - DECL_LINK(OSSelectHdl, ListBox*); + DECL_LINK_TYPED(OSSelectHdl, ListBox&, void); DECL_LINK(EditModifiedHdl, Edit*); ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag); @@ -274,17 +274,15 @@ ListEntryDialog::ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplM SetText(get<FixedText>(rTag + "title")->GetText()); } -IMPL_LINK(ListEntryDialog, OSSelectHdl, ListBox*, pListBox) +IMPL_LINK_TYPED(ListEntryDialog, OSSelectHdl, ListBox&, rListBox, void) { - if (pListBox == mpOS) + if (&rListBox == mpOS) { if (mpOS->GetSelectEntryPos() == 0) maEntry.maOS.clear(); else maEntry.maOS = mpOS->GetSelectEntry(); } - - return 0; } IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index eee1ad2ff536..cdde1a1dffec 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -185,7 +185,7 @@ SvxSaveTabPage::SvxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet pImpl->aDefaultReadonlyArr[APP_WRITER_GLOBAL] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::WRITERGLOBAL); } - Link<> aLink = LINK( this, SvxSaveTabPage, ODFVersionHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxSaveTabPage, ODFVersionHdl_Impl ); aODFVersionLB->SetSelectHdl( aLink ); aLink = LINK( this, SvxSaveTabPage, FilterHdl_Impl ); aDocTypeLB->SetSelectHdl( aLink ); @@ -460,7 +460,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) } } aDocTypeLB->SelectEntryPos(0); - FilterHdl_Impl(aDocTypeLB); + FilterHdl_Impl(*aDocTypeLB); } catch(Exception& e) { @@ -497,7 +497,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) aODFVersionLB->SelectEntryPos( aODFVersionLB->GetEntryPos( pDefaultVersion ) ); AutoClickHdl_Impl( aAutoSaveCB ); - ODFVersionHdl_Impl( aODFVersionLB ); + ODFVersionHdl_Impl( *aODFVersionLB ); aDocInfoCB->SaveValue(); aBackupCB->SaveValue(); @@ -558,7 +558,7 @@ static OUString lcl_ExtracUIName(const Sequence<PropertyValue> &rProperties) return sName; } -IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxSaveTabPage, FilterHdl_Impl, ListBox&, rBox, void ) { const sal_Int32 nCurPos = aDocTypeLB->GetSelectEntryPos(); @@ -568,7 +568,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) if ( nData >= 0 && nData < APP_COUNT ) { - if(aDocTypeLB == pBox) + if(aDocTypeLB == &rBox) { aSaveAsLB->Clear(); const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); @@ -604,7 +604,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) } else { - OUString sSelect = pBox->GetSelectEntry(); + OUString sSelect = rBox.GetSelectEntry(); const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray(); for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++) @@ -618,11 +618,10 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) } } - ODFVersionHdl_Impl( aSaveAsLB ); - return 0; + ODFVersionHdl_Impl( *aSaveAsLB ); }; -IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSaveTabPage, ODFVersionHdl_Impl, ListBox&, void) { sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetSelectEntryData() ); bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST; @@ -645,8 +644,6 @@ IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl) aODFWarningFI->Show( bShown ); aODFWarningFT->Show( bShown ); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx index 0a33a2a36239..06f450723cfc 100644 --- a/cui/source/options/optsave.hxx +++ b/cui/source/options/optsave.hxx @@ -61,8 +61,8 @@ private: SvxSaveTabPage_Impl* pImpl; DECL_LINK_TYPED( AutoClickHdl_Impl, Button*, void ); - DECL_LINK( FilterHdl_Impl, ListBox * ); - DECL_LINK(ODFVersionHdl_Impl, void *); + DECL_LINK_TYPED( FilterHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED(ODFVersionHdl_Impl, ListBox&, void ); void DetectHiddenControls(); diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 2450e1ab9484..905cf4e98a61 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -500,7 +500,7 @@ IMPL_LINK_TYPED( SvxPersonalizationTabPage, DefaultPersona, Button*, pButton, vo } } -IMPL_LINK( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox*, ) +IMPL_LINK_NOARG_TYPED( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox&, void) { m_pOwnPersona->Check(); @@ -519,8 +519,6 @@ IMPL_LINK( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox*, ) aFilter.ImportGraphic( aGraphic, aURLObj ); Bitmap aBmp = aGraphic.GetBitmap(); m_pExtensionPersonaPreview->SetModeImage( Image( aBmp ) ); - - return 0; } /// Find the value on the Persona page, and convert it to a usable form. diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 59e9cbdf81a9..5878033abfd2 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -68,7 +68,7 @@ private: DECL_LINK_TYPED( DefaultPersona, Button*, void ); /// Handle the Personas installed through extensions selection - DECL_LINK( SelectInstalledPersona, ListBox* ); + DECL_LINK_TYPED( SelectInstalledPersona, ListBox&, void ); }; /** Dialog that will allow the user to choose a Persona to use. diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index d3fcb3428db7..c297ce3b5cc4 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -203,7 +203,7 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor // windows to be disabled, if stacked text is turned OFF m_pOrientHlp->AddDependentWindow( *m_pCbAsianMode, TRISTATE_FALSE ); - Link<> aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); + Link<ListBox&,void> aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); m_pLbHorAlign->SetSelectHdl( aLink ); m_pBtnWrap->SetClickHdl( LINK( this, AlignmentTabPage, UpdateEnableClickHdl ) ); @@ -435,10 +435,9 @@ IMPL_LINK_NOARG_TYPED(AlignmentTabPage, UpdateEnableClickHdl, Button*, void) UpdateEnableControls(); } -IMPL_LINK_NOARG(AlignmentTabPage, UpdateEnableHdl) +IMPL_LINK_NOARG_TYPED(AlignmentTabPage, UpdateEnableHdl, ListBox&, void) { UpdateEnableControls(); - return 0; } diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 25ab173d60f8..096ef6d31bcd 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -172,10 +172,10 @@ static bool lcl_FindEntry( ListBox& rLB, const OUString& rEntry, return false; } -IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) +IMPL_LINK_TYPED(OfaAutoCorrDlg, SelectLanguageHdl, ListBox&, rBox, void) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); - void* pVoid = pBox->GetEntryData(nPos); + sal_Int32 nPos = rBox.GetSelectEntryPos(); + void* pVoid = rBox.GetEntryData(nPos); LanguageType eNewLang = (LanguageType)reinterpret_cast<sal_IntPtr>(pVoid); // save old settings and fill anew if(eNewLang != eLastDialogLanguage) @@ -186,7 +186,6 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) else if (m_nExceptionsPageId == nPageId) static_cast<OfaAutocorrExceptPage*>(GetTabPage( nPageId ))->SetLanguage(eNewLang); } - return 0; } OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxItemSet& rSet) @@ -1728,21 +1727,20 @@ bool OfaAutocorrExceptPage::NewDelHdl(void* pBtn) return false; } -IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, ListBox*, pBox) +IMPL_LINK_TYPED(OfaAutocorrExceptPage, SelectHdl, ListBox&, rBox, void) { - if (pBox == m_pAbbrevLB) + if (&rBox == m_pAbbrevLB) { - m_pAbbrevED->SetText(pBox->GetSelectEntry()); + m_pAbbrevED->SetText(rBox.GetSelectEntry()); m_pNewAbbrevPB->Enable(false); m_pDelAbbrevPB->Enable(); } else { - m_pDoubleCapsED->SetText(pBox->GetSelectEntry()); + m_pDoubleCapsED->SetText(rBox.GetSelectEntry()); m_pNewDoublePB->Enable(false); m_pDelDoublePB->Enable(); } - return 0; } IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index b271fc28f144..19da4fa2e2f3 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -551,7 +551,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) } pTableBck_Impl->nTableWhich = SID_ATTR_BRUSH_TABLE; - TblDestinationHdl_Impl(m_pTblLBox); + TblDestinationHdl_Impl(*m_pTblLBox); m_pTblLBox->SaveValue(); } else if( bHighlighting ) @@ -1139,7 +1139,7 @@ IMPL_LINK_NOARG_TYPED(SvxBackgroundTabPage, BackgroundColorHdl_Impl, ValueSet*, m_pPreviewWin1->NotifyChange( aBgdColor ); } -IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBackgroundTabPage, SelectHdl_Impl, ListBox&, void) { if ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) ) { @@ -1149,7 +1149,6 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl) { ShowBitmapUI_Impl(); } - return 0; } IMPL_LINK_TYPED( SvxBackgroundTabPage, FileClickHdl_Impl, Button*, pBox, void ) @@ -1313,9 +1312,9 @@ void SvxBackgroundTabPage::ShowTblControl() m_pAsGrid->Show(); } -IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nSelPos = pBox->GetSelectEntryPos(); + sal_Int32 nSelPos = rBox.GetSelectEntryPos(); if( pTableBck_Impl && pTableBck_Impl->nActPos != nSelPos) { std::unique_ptr<SvxBrushItem> xItemHolder; @@ -1398,7 +1397,6 @@ IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) } FillControls_Impl(*pActItem, aUserData); } - return 0; } void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index fb22d0ade3cd..0dda1cd7af80 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -548,8 +548,8 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) m_pFrameSel->SelectAllVisibleBorders(); // set the current style and color (caches style in control even if nothing is selected) - SelStyleHdl_Impl(m_pLbLineStyle); - SelColHdl_Impl(m_pLbLineColor); + SelStyleHdl_Impl(*m_pLbLineStyle); + SelColHdl_Impl(*m_pLbLineColor); } bool bEnable = m_pWndShadows->GetSelectItemId() > 1 ; @@ -565,7 +565,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) if ( m_pLbLineStyle->GetSelectEntryPos() == 0 ) { m_pLbLineStyle->SelectEntryPos( 1 ); - SelStyleHdl_Impl(m_pLbLineStyle); + SelStyleHdl_Impl(*m_pLbLineStyle); } const SfxPoolItem* pItem; @@ -836,8 +836,8 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, SelPreHdl_Impl, ValueSet*, void) m_pLbLineStyle->SelectEntryPos( 1 ); // set current style to all previously selected lines - SelStyleHdl_Impl(m_pLbLineStyle); - SelColHdl_Impl(m_pLbLineColor); + SelStyleHdl_Impl(*m_pLbLineStyle); + SelColHdl_Impl(*m_pLbLineColor); } // Presets ValueSet does not show a selection (used as push buttons). @@ -859,17 +859,15 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, SelSdwHdl_Impl, ValueSet*, void) -IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb ) +IMPL_LINK_TYPED( SvxBorderTabPage, SelColHdl_Impl, ListBox&, rLb, void ) { - ColorListBox* pColLb = static_cast<ColorListBox*>(pLb); + ColorListBox* pColLb = static_cast<ColorListBox*>(&rLb); - if (pLb == m_pLbLineColor) + if (&rLb == m_pLbLineColor) { m_pFrameSel->SetColorToSelection( pColLb->GetSelectEntryColor() ); m_pLbLineStyle->SetColor( pColLb->GetSelectEntryColor() ); } - - return 0; } IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) @@ -888,9 +886,9 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) -IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb ) +IMPL_LINK_TYPED( SvxBorderTabPage, SelStyleHdl_Impl, ListBox&, rLb, void ) { - if (pLb == m_pLbLineStyle) + if (&rLb == m_pLbLineStyle) { sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), @@ -899,8 +897,6 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb ) m_pFrameSel->SetStyleToSelection ( nVal, SvxBorderStyle( m_pLbLineStyle->GetSelectEntryStyle() ) ); } - - return 0; } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 34e77c2f8a28..451930219ec7 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -431,11 +431,11 @@ void SvxCharNamePage::Initialize() m_pEastFontNameLB->SetModifyHdl( aLink ); m_pEastFontStyleLB->SetModifyHdl( aLink ); m_pEastFontSizeLB->SetModifyHdl( aLink ); - m_pEastFontLanguageLB->SetSelectHdl( aLink ); + m_pEastFontLanguageLB->SetSelectHdl( LINK( this, SvxCharNamePage, FontModifyListBoxHdl_Impl ) ); m_pCTLFontNameLB->SetModifyHdl( aLink ); m_pCTLFontStyleLB->SetModifyHdl( aLink ); m_pCTLFontSizeLB->SetModifyHdl( aLink ); - m_pCTLFontLanguageLB->SetSelectHdl( aLink ); + m_pCTLFontLanguageLB->SetSelectHdl( LINK( this, SvxCharNamePage, FontModifyListBoxHdl_Impl ) ); m_pImpl->m_aUpdateIdle.SetIdleHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) ); } @@ -1183,6 +1183,10 @@ IMPL_LINK_NOARG_TYPED(SvxCharNamePage, UpdateHdl_Impl, Idle *, void) +IMPL_LINK_TYPED( SvxCharNamePage, FontModifyListBoxHdl_Impl, ListBox&, rBox, void ) +{ + FontModifyHdl_Impl(&rBox); +} IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox ) { m_pImpl->m_aUpdateIdle.Start(); @@ -1482,7 +1486,7 @@ void SvxCharEffectsPage::Initialize() m_pFontColorLB->SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) ); // handler - Link<> aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxCharEffectsPage, SelectListBoxHdl_Impl ); m_pUnderlineLB->SetSelectHdl( aLink ); m_pUnderlineColorLB->SetSelectHdl( aLink ); m_pOverlineLB->SetSelectHdl( aLink ); @@ -1701,7 +1705,11 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) -IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharEffectsPage, SelectListBoxHdl_Impl, ListBox&, rBox, void ) +{ + SelectHdl_Impl(&rBox); +} +void SvxCharEffectsPage::SelectHdl_Impl( ListBox* pBox ) { if ( m_pEmphasisLB == pBox ) { @@ -1730,12 +1738,11 @@ IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox ) m_pIndividualWordsBtn->Enable( bUEnable || bOEnable || ( nSPos > 0 && nSPos != LISTBOX_ENTRY_NOTFOUND ) ); } UpdatePreview_Impl(); - return 0; } -IMPL_LINK_NOARG(SvxCharEffectsPage, UpdatePreview_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharEffectsPage, UpdatePreview_Impl, ListBox&, void) { bool bEnable = ( ( m_pUnderlineLB->GetSelectEntryPos() > 0 ) || ( m_pOverlineLB->GetSelectEntryPos() > 0 ) || @@ -1743,7 +1750,6 @@ IMPL_LINK_NOARG(SvxCharEffectsPage, UpdatePreview_Impl) m_pIndividualWordsBtn->Enable( bEnable ); UpdatePreview_Impl(); - return 0; } @@ -1762,8 +1768,9 @@ IMPL_LINK_NOARG_TYPED(SvxCharEffectsPage, TristClickHdl_Impl, Button*, void) -IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ListBox&, rListBox, void ) { + ColorListBox* pBox = static_cast<ColorListBox*>(&rListBox); SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); SvxFont& rCTLFont = GetPreviewCTLFont(); @@ -1778,7 +1785,6 @@ IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); m_pPreviewWin->Invalidate(); - return 0; } @@ -2028,20 +2034,18 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet ) } // the select handler for the underline/overline/strikeout list boxes -// SelectHdl_Impl( NULL ); DBG_ASSERT(m_pUnderlineLB->GetSelectHdl() == m_pOverlineLB->GetSelectHdl(), "SvxCharEffectsPage::Reset: inconsistence (1)!"); DBG_ASSERT(m_pUnderlineLB->GetSelectHdl() == m_pStrikeoutLB->GetSelectHdl(), "SvxCharEffectsPage::Reset: inconsistence (1)!"); - m_pUnderlineLB->GetSelectHdl().Call(NULL); + m_pUnderlineLB->GetSelectHdl().Call(*m_pUnderlineLB); // don't call SelectHdl_Impl directly! // in DisableControls, we may have re-routed the select handler // the select handler for the emphasis listbox -// SelectHdl_Impl( m_pEmphasisLB ); - DBG_ASSERT(m_pEmphasisLB->GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectHdl_Impl), + DBG_ASSERT(m_pEmphasisLB->GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectListBoxHdl_Impl), "SvxCharEffectsPage::Reset: inconsistence (2)!"); - m_pEmphasisLB->GetSelectHdl().Call( m_pEmphasisLB ); + m_pEmphasisLB->GetSelectHdl().Call( *m_pEmphasisLB ); // this is for consistency only. Here it would be allowed to call SelectHdl_Impl directly ... // Effects @@ -2704,7 +2708,7 @@ void SvxCharPositionPage::Initialize() m_pNormalPosBtn->Check(); PositionHdl_Impl( m_pNormalPosBtn ); m_pKerningLB->SelectEntryPos( 0 ); - KerningSelectHdl_Impl( NULL ); + KerningSelectHdl_Impl( *m_pKerningLB ); Link<Button*,void> aLink2 = LINK( this, SvxCharPositionPage, PositionHdl_Impl ); m_pHighPosBtn->SetClickHdl( aLink2 ); @@ -2853,7 +2857,7 @@ IMPL_LINK_TYPED( SvxCharPositionPage, FitToLineHdl_Impl, Button*, pBox, void ) -IMPL_LINK_NOARG(SvxCharPositionPage, KerningSelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, KerningSelectHdl_Impl, ListBox&, void) { if ( m_pKerningLB->GetSelectEntryPos() > LW_NORMAL ) { @@ -2882,8 +2886,6 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningSelectHdl_Impl) } KerningModifyHdl_Impl( NULL ); - - return 0; } @@ -3126,7 +3128,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) m_pKerningLB->SelectEntryPos( LW_NORMAL ); } //enable/disable and set min/max of the Edit - KerningSelectHdl_Impl(m_pKerningLB); + KerningSelectHdl_Impl(*m_pKerningLB); //the attribute value must be displayed also if it's above the maximum allowed value long nVal = static_cast<long>(m_pKerningMF->GetMax()); if(nVal < nKerning) @@ -3431,7 +3433,7 @@ void SvxCharTwoLinesPage::Initialize() m_pTwoLinesBtn->SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) ); - Link<> aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); m_pStartBracketLB->SetSelectHdl( aLink ); m_pEndBracketLB->SetSelectHdl( aLink ); @@ -3512,21 +3514,20 @@ IMPL_LINK_NOARG_TYPED(SvxCharTwoLinesPage, TwoLinesHdl_Impl, Button*, void) -IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); - if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == reinterpret_cast<sal_uLong>(pBox->GetEntryData( nPos )) ) - SelectCharacter( pBox ); + sal_Int32 nPos = rBox.GetSelectEntryPos(); + if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == reinterpret_cast<sal_uLong>(rBox.GetEntryData( nPos )) ) + SelectCharacter( &rBox ); else { - bool bStart = pBox == m_pStartBracketLB; + bool bStart = &rBox == m_pStartBracketLB; if( bStart ) m_nStartBracketPosition = nPos; else m_nEndBracketPosition = nPos; } UpdatePreview_Impl(); - return 0; } diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index 21fa98fa7fc2..e7fa56d2a6ab 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -128,7 +128,7 @@ SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rI m_pMtrFldLine1->SetModifyHdl( aLink ); m_pMtrFldLine2->SetModifyHdl( aLink ); m_pMtrFldLine3->SetModifyHdl( aLink ); - m_pLbType->SetSelectHdl( aLink ); + m_pLbType->SetSelectHdl( LINK( this, SvxConnectionPage, ChangeAttrListBoxHdl_Impl ) ); } SvxConnectionPage::~SvxConnectionPage() @@ -396,6 +396,10 @@ VclPtr<SfxTabPage> SvxConnectionPage::Create( vcl::Window* pWindow, return VclPtr<SvxConnectionPage>::Create( pWindow, *rAttrs ); } +IMPL_LINK_TYPED( SvxConnectionPage, ChangeAttrListBoxHdl_Impl, ListBox&, r, void ) +{ + ChangeAttrHdl_Impl(&r); +} IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p ) { if( p == m_pMtrFldHorz1 ) diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index 61ebffe4687f..60f575fd9696 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -422,22 +422,20 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType ) -IMPL_LINK( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox&, rListBox, void ) { - if (pListBox == m_pLB_ANSATZ) + if (&rListBox == m_pLB_ANSATZ) { SetupAnsatz_Impl( m_pLB_ANSATZ->GetSelectEntryPos() ); } - return 0; } -IMPL_LINK( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox&, rListBox, void ) { - if (pListBox == m_pLB_ANSATZ_REL) + if (&rListBox == m_pLB_ANSATZ_REL) { nAnsatzRelPos = m_pLB_ANSATZ_REL->GetSelectEntryPos(); } - return 0; } IMPL_LINK_TYPED( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton, void ) diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 2d76be168a90..88a859564d61 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -145,7 +145,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs m_pTsbBelowRefEdge->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); m_pTsbParallel->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); m_pTsbShowUnit->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); - m_pLbUnit->SetSelectHdl( aLink ); + m_pLbUnit->SetSelectHdl( LINK( this, SvxMeasurePage, ChangeAttrListBoxHdl_Impl ) ); } SvxMeasurePage::~SvxMeasurePage() @@ -664,9 +664,12 @@ IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrClickHdl_Impl, Button*, p, void ) { ChangeAttrHdl_Impl(p); } +IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrListBoxHdl_Impl, ListBox&, rBox, void ) +{ + ChangeAttrHdl_Impl(&rBox); +} IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) { - if( p == m_pMtrFldLineDist ) { sal_Int32 nValue = GetCoreValue( *m_pMtrFldLineDist, eUnit ); diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index e9aa60a197a6..4e666c9bec2e 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -335,15 +335,15 @@ void SvxNumberFormatTabPage::Init_Impl() m_pCbSourceFormat->Disable(); m_pCbSourceFormat->Hide(); - Link<> aLink = LINK( this, SvxNumberFormatTabPage, SelFormatHdl_Impl ); + Link<ListBox&,void> aLink2 = LINK( this, SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl ); - m_pLbCategory->SetSelectHdl( aLink ); - m_pLbFormat->SetSelectHdl( LINK( this, SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl ) ); - m_pLbLanguage->SetSelectHdl( aLink ); - m_pLbCurrency->SetSelectHdl( aLink ); + m_pLbCategory->SetSelectHdl( aLink2 ); + m_pLbFormat->SetSelectHdl( LINK( this, SvxNumberFormatTabPage, SelFormatTreeListBoxHdl_Impl ) ); + m_pLbLanguage->SetSelectHdl( aLink2 ); + m_pLbCurrency->SetSelectHdl( aLink2 ); m_pCbSourceFormat->SetClickHdl( LINK( this, SvxNumberFormatTabPage, SelFormatClickHdl_Impl ) ); - aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); + Link<> aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); m_pEdDecimals->SetModifyHdl( aLink ); m_pEdLeadZeroes->SetModifyHdl( aLink ); @@ -356,9 +356,7 @@ void SvxNumberFormatTabPage::Init_Impl() m_pIbInfo->SetClickHdl( HDL( ClickHdl_Impl ) ); UpdateThousandEngineeringText(); - Link<Control&,void> aLink2 = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl); - - m_pEdComment->SetLoseFocusHdl( aLink2); + m_pEdComment->SetLoseFocusHdl( LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl) ); aResetWinTimer.SetTimeoutHdl(LINK( this, SvxNumberFormatTabPage, TimeHdl_Impl)); aResetWinTimer.SetTimeout( 10); @@ -1194,17 +1192,21 @@ IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatClickHdl_Impl, Button*, pLb, v { SelFormatHdl_Impl(pLb); } -IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl, SvTreeListBox*, pLb, void ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatTreeListBoxHdl_Impl, SvTreeListBox*, pLb, void ) { SelFormatHdl_Impl(pLb); } -IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl, ListBox&, rLb, void ) +{ + SelFormatHdl_Impl(&rLb); +} +void SvxNumberFormatTabPage::SelFormatHdl_Impl(void * pLb ) { if (pLb == m_pCbSourceFormat) { EnableBySourceFormat_Impl(); // enable/disable everything else if ( m_pCbSourceFormat->IsChecked() ) - return 0; // just disabled everything else + return; // just disabled everything else // Reinit options enable/disable for current selection. @@ -1280,7 +1282,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) } UpdateOptions_Impl( false ); - return 0; + return; } @@ -1291,7 +1293,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) EditHdl_Impl( NULL ); UpdateOptions_Impl( false ); - return 0; + return; } @@ -1301,9 +1303,8 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) UpdateFormatListBox_Impl( false, true ); EditHdl_Impl(m_pEdFormat); - return 0; + return; } - return 0; } diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 14abb1d56f60..fe69953ca189 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1526,7 +1526,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet ) { m_pAlignFT->Show(); m_pAlignLB->Show(); - m_pAlignLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); + m_pAlignLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditListBoxHdl_Impl)); } else { @@ -1801,29 +1801,29 @@ void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType, bool ) m_pOrientLB->Enable(bEnableBitmap); } -IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox&, rBox, void ) { sal_uInt16 nSaveNumLvl = nActNumLvl; nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) + if(rBox.IsEntryPosSelected( pActNum->GetLevelCount() ) && + (rBox.GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) { nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(false); + rBox.SetUpdateMode(false); for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, false ); - pBox->SetUpdateMode(true); + rBox.SelectEntryPos( i, false ); + rBox.SetUpdateMode(true); } - else if(pBox->GetSelectEntryCount()) + else if(rBox.GetSelectEntryCount()) { sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActNumLvl |= nMask; nMask <<= 1; } - pBox->SelectEntryPos( pActNum->GetLevelCount(), false ); + rBox.SelectEntryPos( pActNum->GetLevelCount(), false ); } else { @@ -1833,14 +1833,13 @@ IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox ) { if(nActNumLvl & nMask) { - pBox->SelectEntryPos(i); + rBox.SelectEntryPos(i); break; } nMask <<=1; } } InitControls(); - return 0; } IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, void) @@ -1868,7 +1867,7 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox ) return 0; } -IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void ) { OUString sSelectStyle; bool bShowOrient = false; @@ -1880,7 +1879,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) { SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); // PAGEDESC does not exist - sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetSelectEntryData()); + sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(rBox.GetSelectEntryData()); aNumFmt.SetNumberingType((sal_Int16)nNumType); sal_uInt16 nNumberingType = aNumFmt.GetNumberingType(); if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN))) @@ -1944,10 +1943,9 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) if(!sSelectStyle.isEmpty()) { m_pCharFmtLB->SelectEntry(sSelectStyle); - CharFmtHdl_Impl(m_pCharFmtLB); + CharFmtHdl_Impl(*m_pCharFmtLB); bAutomaticCharStyles = true; } - return 0; } void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) @@ -1961,9 +1959,9 @@ void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) m_pStartED->GetModifyHdl().Call(m_pStartED); } -IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); nPos ++; // no VERT_NONE sal_uInt16 nMask = 1; @@ -1984,8 +1982,6 @@ IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox ) nMask <<= 1; } SetModified(false); - return 0; - } IMPL_LINK_TYPED( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void ) @@ -2006,8 +2002,9 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void ) InitControls(); } -IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, BulColorHdl_Impl, ListBox&, rListBox, void ) { + ColorListBox* pBox = static_cast<ColorListBox*>(&rListBox); Color nSetColor = pBox->GetSelectEntryColor(); sal_uInt16 nMask = 1; @@ -2022,7 +2019,6 @@ IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox ) nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField) @@ -2315,7 +2311,7 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, RatioHdl_Impl, Button*, pBox, void ) } } -IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox&, void) { bAutomaticCharStyles = false; sal_Int32 nEntryPos = m_pCharFmtLB->GetSelectEntryPos(); @@ -2338,10 +2334,12 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl) nMask <<= 1; } SetModified(false); - return 0; - }; +IMPL_LINK_NOARG_TYPED( SvxNumOptionsTabPage, EditListBoxHdl_Impl, ListBox&, void ) +{ + EditModifyHdl_Impl(nullptr); +} IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit ) { bool bPrefix = pEdit == m_pPrefixED; @@ -3313,7 +3311,7 @@ void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric) m_pIndentAtMF->SetUnit( eMetric ); } -IMPL_LINK_NOARG(SvxNumPositionTabPage, EditModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, EditModifyHdl_Impl, ListBox&, void) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -3336,32 +3334,31 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, EditModifyHdl_Impl) nMask <<= 1; } SetModified(); - return 0; } -IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumPositionTabPage, LevelHdl_Impl, ListBox&, rBox, void ) { sal_uInt16 nSaveNumLvl = nActNumLvl; nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) + if(rBox.IsEntryPosSelected( pActNum->GetLevelCount() ) && + (rBox.GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) { nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(false); + rBox.SetUpdateMode(false); for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, false ); - pBox->SetUpdateMode(true); + rBox.SelectEntryPos( i, false ); + rBox.SetUpdateMode(true); } - else if(pBox->GetSelectEntryCount()) + else if(rBox.GetSelectEntryCount()) { sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActNumLvl |= nMask; nMask <<= 1; } - pBox->SelectEntryPos( pActNum->GetLevelCount(), false ); + rBox.SelectEntryPos( pActNum->GetLevelCount(), false ); } else { @@ -3371,7 +3368,7 @@ IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) { if(nActNumLvl & nMask) { - pBox->SelectEntryPos(i); + rBox.SelectEntryPos(i); break; } nMask <<=1; @@ -3382,7 +3379,6 @@ IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); InitControls(); - return 0; } IMPL_LINK_TYPED( SvxNumPositionTabPage, DistanceFocusHdl_Impl, Control&, rControl, void ) @@ -3492,7 +3488,7 @@ IMPL_LINK_TYPED( SvxNumPositionTabPage, RelativeHdl_Impl, Button*, pBox, void ) bLastRelative = bOn; } -IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&, void) { // determine value to be set at the chosen list levels SvxNumberFormat::LabelFollowedBy eLabelFollowedBy = SvxNumberFormat::LISTTAB; @@ -3547,8 +3543,6 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl) } SetModified(); - - return 0; } IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld ) diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index fc90d1fa01d7..9310f1642371 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -494,7 +494,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // alignment m_pLayoutBox->SelectEntryPos( ::PageUsageToPos_Impl( nUse ) ); m_pBspWin->SetUsage( nUse ); - LayoutHdl_Impl( 0 ); + LayoutHdl_Impl( *m_pLayoutBox ); //adjust numeration type of the page style //Get the Position of the saved NumType @@ -927,7 +927,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) -IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxPageDescPage, LayoutHdl_Impl, ListBox&, void) { // switch inside outside const sal_uInt16 nPos = PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() ); @@ -947,7 +947,6 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl) m_pOutsideLbl->Hide(); } UpdateExample_Impl( true ); - return 0; } @@ -987,9 +986,9 @@ IMPL_LINK_NOARG_TYPED(SvxPageDescPage, PaperBinHdl_Impl, Control&, void) -IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) { - const sal_Int32 nPos = pBox->GetSelectEntryPos(); + const sal_Int32 nPos = rBox.GetSelectEntryPos(); Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData( nPos )); if ( ePaper != PAPER_USER ) @@ -1054,7 +1053,6 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) UpdateExample_Impl( true ); } } - return 0; } @@ -1103,7 +1101,7 @@ IMPL_LINK_TYPED( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void ) // recalculate margins if necessary CalcMargin_Impl(); - PaperSizeSelect_Impl( m_pPaperSizeBox ); + PaperSizeSelect_Impl( *m_pPaperSizeBox ); RangeHdl_Impl( *m_pPaperWidthEdit ); SwapFirstValues_Impl( bBorderModified ); UpdateExample_Impl( true ); @@ -1694,11 +1692,10 @@ void SvxPageDescPage::DisableVerticalPageDir() } } -IMPL_LINK( SvxPageDescPage, FrameDirectionModify_Impl, ListBox*,) +IMPL_LINK_NOARG_TYPED( SvxPageDescPage, FrameDirectionModify_Impl, ListBox&, void) { m_pBspWin->SetFrameDirection( (sal_uInt32) m_pTextFlowBox->GetSelectEntryValue() ); m_pBspWin->Invalidate(); - return 0; } bool SvxPageDescPage::IsPrinterRangeOverflow( diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index d4617e22548b..7d9965c57fac 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -765,12 +765,12 @@ void SvxStdParagraphTabPage::SetLineSpacing_Impl break; default: ;//prevent warning } - LineDistHdl_Impl( m_pLineDist ); + LineDistHdl_Impl( *m_pLineDist ); } -IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void ) { - switch( pBox->GetSelectEntryPos() ) + switch( rBox.GetSelectEntryPos() ) { case LLINESPACE_1: case LLINESPACE_15: @@ -832,7 +832,6 @@ IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox ) break; } UpdateExample_Impl(); - return 0; } IMPL_LINK_NOARG(SvxStdParagraphTabPage, ModifyHdl_Impl) @@ -1295,16 +1294,15 @@ IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, AlignHdl_Impl, Button*, void) UpdateExample_Impl(); } -IMPL_LINK_NOARG(SvxParaAlignTabPage, LastLineHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, LastLineHdl_Impl, ListBox&, void) { //fdo#41350 only enable 'Expand last word' if last line is also justified bool bLastLineIsBlock = m_pLastLineLB->GetSelectEntryPos() == 2; m_pExpandCB->Enable(bLastLineIsBlock); UpdateExample_Impl(); - return 0; } -IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox&, void) { SvxFrameDirection eDir = m_pTextDirectionLB->GetSelectEntryValue(); switch ( eDir ) @@ -1318,8 +1316,6 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl) SAL_WARN( "cui.tabpages", "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" ); } } - - return 0; } void SvxParaAlignTabPage::UpdateExample_Impl() @@ -1737,7 +1733,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) } } - PageBreakPosHdl_Impl( m_pBreakPositionLB ); + PageBreakPosHdl_Impl( *m_pBreakPositionLB ); PageBreakHdl_Impl( m_pPageBreakBox ); } @@ -2127,9 +2123,9 @@ IMPL_LINK_NOARG_TYPED(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl, Button*, v } } -IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox&, rListBox, void ) { - if ( 0 == pListBox->GetSelectEntryPos() ) + if ( 0 == rListBox.GetSelectEntryPos() ) { m_pApplyCollBtn->Enable(); @@ -2143,7 +2139,7 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) m_pPagenumEdit->Enable(bEnable); } } - else if ( 1 == pListBox->GetSelectEntryPos() ) + else if ( 1 == rListBox.GetSelectEntryPos() ) { m_pApplyCollBtn->SetState( TRISTATE_FALSE ); m_pApplyCollBtn->Enable(false); @@ -2151,14 +2147,13 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) m_pPagenumText->Enable(false); m_pPagenumEdit->Enable(false); } - return 0; } -IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox&, rListBox, void ) { //column break or break break after sal_Int32 nBreakPos = m_pBreakPositionLB->GetSelectEntryPos(); - if ( pListBox->GetSelectEntryPos() == 1 || 1 == nBreakPos) + if ( rListBox.GetSelectEntryPos() == 1 || 1 == nBreakPos) { m_pApplyCollBtn->SetState( TRISTATE_FALSE ); m_pApplyCollBtn->Enable(false); @@ -2167,8 +2162,7 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox ) m_pPagenumEdit->Enable(false); } else - PageBreakPosHdl_Impl( m_pBreakPositionLB ); - return 0; + PageBreakPosHdl_Impl( *m_pBreakPositionLB ); } void SvxExtParagraphTabPage::PageCreated(const SfxAllItemSet& aSet) diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 65a6a0867789..c115591a0af9 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1237,8 +1237,8 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void) if(m_bHtmlMode) { - PosHdl(m_pHoriLB); - PosHdl(m_pVertLB); + PosHdl(*m_pHoriLB); + PosHdl(*m_pVertLB); } } @@ -1248,9 +1248,9 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, MirrorHdl, Button*, void) InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX); } -IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SvxSwPosSizeTabPage, RelHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriToLB; + bool bHori = &rLB == m_pHoriToLB; UpdateExample(); @@ -1274,23 +1274,19 @@ IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB ) } } } - if (pLB) // only if the handler has been called by a change of the controller - RangeModifyHdl(*m_pWidthMF); - - return 0; - + RangeModifyHdl(*m_pWidthMF); } -IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SvxSwPosSizeTabPage, PosHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriLB; + bool bHori = &rLB == m_pHoriLB; ListBox *pRelLB = bHori ? m_pHoriToLB : m_pVertToLB; FixedText *pRelFT = bHori ? m_pHoriToFT : m_pVertToFT; FrmMap *pMap = bHori ? m_pHMap : m_pVMap; - sal_uInt16 nMapPos = GetMapPos(pMap, *pLB); - sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); + sal_uInt16 nMapPos = GetMapPos(pMap, rLB); + sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, rLB, *pRelLB); if (bHori) { @@ -1308,7 +1304,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) RangeModifyHdl( *m_pWidthMF ); short nRel = 0; - if (pLB->GetSelectEntryCount()) + if (rLB.GetSelectEntryCount()) { if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) @@ -1354,7 +1350,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) bSet = true; } if(bSet) - PosHdl(m_pVertLB); + PosHdl(*m_pVertLB); } else { @@ -1377,11 +1373,10 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) m_pHoriToLB->SelectEntryPos(0) ; } if(bSet) - PosHdl(m_pHoriLB); + PosHdl(*m_pHoriLB); } } - return 0; } IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit ) @@ -1816,7 +1811,7 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u rLB.Enable(rLB.GetEntryCount() != 0); rFT.Enable(rLB.GetEntryCount() != 0); - RelHdl(&rLB); + RelHdl(rLB); return nLBRelations; } @@ -1869,7 +1864,7 @@ sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap, if (!_rLB.GetSelectEntryCount()) _rLB.SelectEntryPos(0); - PosHdl(&_rLB); + PosHdl(_rLB); return GetMapPos(_pMap, _rLB); } diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 0a5e83e47460..4ffacbe99e71 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -335,7 +335,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) m_pMtrFldAmount->SaveValue(); - SelectEffectHdl_Impl( NULL ); + SelectEffectHdl_Impl( *m_pLbEffect ); ClickEndlessHdl_Impl( NULL ); ClickAutoHdl_Impl( NULL ); //ClickPixelHdl_Impl( NULL ); @@ -467,7 +467,7 @@ VclPtr<SfxTabPage> SvxTextAnimationPage::Create( vcl::Window* pWindow, return VclPtr<SvxTextAnimationPage>::Create( pWindow, *rAttrs ); } -IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxTextAnimationPage, SelectEffectHdl_Impl, ListBox&, void) { sal_Int32 nPos = m_pLbEffect->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -522,7 +522,6 @@ IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl) } } - return 0L; } IMPL_LINK_NOARG_TYPED(SvxTextAnimationPage, ClickEndlessHdl_Impl, Button*, void) diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 3d0e20cf2ce3..31d8f9cdda63 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -155,6 +155,10 @@ IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl) return 0L; } +IMPL_LINK_TYPED(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, ListBox&, rListBox, void) +{ + ModifiedTrgrHdl_Impl(&rListBox); +} IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl) { if(pControl == m_pLbTrgrGradientType || pControl == this) @@ -288,7 +292,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt m_pMtrTrgrEndValue->SetValue( 100 ); m_pMtrTrgrStartValue->SetValue( 0 ); Link<> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrHdl_Impl); - m_pLbTrgrGradientType->SetSelectHdl( aLink ); + m_pLbTrgrGradientType->SetSelectHdl( LINK( this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl) ); m_pMtrTrgrCenterX->SetModifyHdl( aLink ); m_pMtrTrgrCenterY->SetModifyHdl( aLink ); m_pMtrTrgrAngle->SetModifyHdl( aLink ); @@ -879,7 +883,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbBitmap->SelectEntryPos( 0 ); else m_pLbBitmap->SelectEntryPos( _nPos ); - ModifyBitmapHdl_Impl( this ); + ModifyBitmapHdl_Impl( *m_pLbBitmap ); } if( *m_pnHatchingListState != ChangeType::NONE ) @@ -898,9 +902,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbHatching->SelectEntryPos( 0 ); else m_pLbHatching->SelectEntryPos( _nPos ); - ModifyHatchingHdl_Impl( this ); + ModifyHatchingHdl_Impl( *m_pLbHatching ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); } if( *m_pnGradientListState != ChangeType::NONE ) @@ -919,7 +923,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbGradient->SelectEntryPos( 0 ); else m_pLbGradient->SelectEntryPos( _nPos ); - ModifyGradientHdl_Impl( this ); + ModifyGradientHdl_Impl( *m_pLbGradient ); } if( *m_pnColorListState != ChangeType::NONE ) @@ -938,7 +942,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbColor->SelectEntryPos( _nPos ); - ModifyColorHdl_Impl( this ); + ModifyColorHdl_Impl( *m_pLbColor ); // Backgroundcolor of hatch _nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos(); @@ -952,7 +956,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbHatchBckgrdColor->SelectEntryPos( _nPos ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); } // evaluate if any other Tabpage set another filltype @@ -1848,7 +1852,7 @@ VclPtr<SfxTabPage> SvxAreaTabPage::Create( vcl::Window* pWindow, -IMPL_LINK_NOARG(SvxAreaTabPage, SelectDialogTypeHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, SelectDialogTypeHdl_Impl, ListBox&, void) { switch( (drawing::FillStyle)m_pTypeLB->GetSelectEntryPos() ) { @@ -1859,8 +1863,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, SelectDialogTypeHdl_Impl) case drawing::FillStyle_HATCH: ClickHatchingHdl_Impl(); break; case drawing::FillStyle_BITMAP: ClickBitmapHdl_Impl(); break; } - - return 0; } void SvxAreaTabPage::ClickInvisibleHdl_Impl() @@ -1906,12 +1908,12 @@ void SvxAreaTabPage::ClickColorHdl_Impl() // Controls for Hatch-Background m_pFlHatchBckgrd->Hide(); - ModifyColorHdl_Impl( this ); + ModifyColorHdl_Impl( *m_pLbColor ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyColorHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbColor->GetSelectEntryPos(); @@ -1933,8 +1935,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyColorHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -1961,13 +1961,13 @@ void SvxAreaTabPage::ClickGradientHdl_Impl() // Controls for Hatch-Background m_pFlHatchBckgrd->Hide(); - ModifyGradientHdl_Impl( this ); + ModifyGradientHdl_Impl( *m_pLbGradient ); ModifyStepCountHdl_Impl( m_pTsbStepCount ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyGradientHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyGradientHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbGradient->GetSelectEntryPos(); @@ -1989,8 +1989,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyGradientHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -2016,14 +2014,14 @@ void SvxAreaTabPage::ClickHatchingHdl_Impl() m_pCbxHatchBckgrd->Enable(); m_pLbHatchBckgrdColor->Enable(); - ModifyHatchingHdl_Impl( this ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchingHdl_Impl( *m_pLbHatching ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); ToggleHatchBckgrdColorHdl_Impl( *m_pCbxHatchBckgrd ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchingHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchingHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbHatching->GetSelectEntryPos(); @@ -2045,13 +2043,11 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchingHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos(); @@ -2070,8 +2066,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -2140,13 +2134,13 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl() m_pBxBitmap->Show(); - ModifyBitmapHdl_Impl( this ); + ModifyBitmapHdl_Impl( *m_pLbBitmap ); ModifyTileHdl_Impl( m_pTsbOriginal ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyBitmapHdl_Impl, ListBox&, void) { //UUUU mbDirectGraphicSet = false; @@ -2173,8 +2167,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl) m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlBitmapPreview->Invalidate(); - - return 0L; } diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 22fa3d32056e..d9fc6138557f 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -195,8 +195,8 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) else m_pLbBackgroundColor->SelectEntryPos( nPos ); - ChangePixelColorHdl_Impl( this ); - ChangeBackgrndColorHdl_Impl( this ); + ChangePixelColorHdl_Impl( *m_pLbColor ); + ChangeBackgrndColorHdl_Impl( *m_pLbBackgroundColor ); } // determining (possibly cutting) the name and @@ -221,7 +221,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) m_pLbBitmaps->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); *m_pPageType = PT_BITMAP; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -288,7 +288,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); // determine button state if( m_pBitmapList.is() && m_pBitmapList->Count() ) @@ -316,7 +316,7 @@ VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow, -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBitmapHdl_Impl, ListBox&, void) { std::unique_ptr<GraphicObject> pGraphicObject; int nPos(m_pLbBitmaps->GetSelectEntryPos()); @@ -429,8 +429,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl) m_bBmpChanged = false; } - - return 0; } @@ -570,7 +568,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) *m_pnBitmapListState |= ChangeType::MODIFIED; - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); } } @@ -659,7 +657,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl_Impl, Button*, void) *m_pnBitmapListState |= ChangeType::MODIFIED; - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); } } else @@ -752,7 +750,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); m_pCtlPixel->Invalidate(); - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); *m_pnBitmapListState |= ChangeType::MODIFIED; } @@ -937,7 +935,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangePixelColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangePixelColorHdl_Impl, ListBox&, void) { m_pCtlPixel->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); m_pCtlPixel->Invalidate(); @@ -950,13 +948,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangePixelColorHdl_Impl) m_pCtlPreview->Invalidate(); m_bBmpChanged = true; - - return 0L; } -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, ListBox&, void) { m_pCtlPixel->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); m_pCtlPixel->Invalidate(); @@ -969,8 +965,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl) m_pCtlPreview->Invalidate(); m_bBmpChanged = true; - - return 0L; } diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index be9c42beba58..48455fdd16f6 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -278,7 +278,7 @@ void SvxColorTabPage::Update(bool bLoaded) XColorEntry* pEntry = pColorList->GetColor( nPos ); ChangeColor(pEntry->GetColor()); } - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); } UpdateModified(); @@ -499,7 +499,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& ) } // so that the possibly changed color is discarded - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); *pPageType = PT_COLOR; *pPos = LISTBOX_ENTRY_NOTFOUND; @@ -641,7 +641,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet ) m_pLbColorModel->SelectEntryPos( aStr.toInt32() ); ChangeColor(aNewColor); - SelectColorModelHdl_Impl( this ); + SelectColorModelHdl_Impl( *m_pLbColorModel ); m_pCtlPreviewOld->Invalidate(); UpdateModified(); @@ -762,7 +762,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickAddHdl_Impl, Button*, void) *pnColorListState |= ChangeType::MODIFIED; - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); } UpdateModified(); @@ -900,7 +900,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void) // positioning m_pLbColor->SelectEntryPos( nPos ); - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); m_pCtlPreviewOld->Invalidate(); @@ -912,7 +912,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxColorTabPage, SelectColorLBHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorLBHdl_Impl, ListBox&, void) { sal_Int32 nPos = m_pLbColor->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -931,7 +931,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorLBHdl_Impl) XColorEntry* pEntry = pColorList->GetColor(nPos); ChangeColor(pEntry->GetColor()); } - return 0; } @@ -980,7 +979,7 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell) } } -IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorModelHdl_Impl, ListBox&, void) { int nPos = m_pLbColorModel->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -1008,8 +1007,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl) ChangeColor(aCurrentColor); } - - return 0; } diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 7bf1bdb2dc7a..62f69953475b 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -116,15 +116,16 @@ SvxGradientTabPage::SvxGradientTabPage LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); Link<> aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl ); - m_pLbGradientType->SetSelectHdl( aLink ); + Link<ListBox&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl ); + m_pLbGradientType->SetSelectHdl( aLink2 ); m_pMtrCenterX->SetModifyHdl( aLink ); m_pMtrCenterY->SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink ); m_pMtrBorder->SetModifyHdl( aLink ); m_pMtrColorFrom->SetModifyHdl( aLink ); - m_pLbColorFrom->SetSelectHdl( aLink ); + m_pLbColorFrom->SetSelectHdl( aLink2 ); m_pMtrColorTo->SetModifyHdl( aLink ); - m_pLbColorTo->SetSelectHdl( aLink ); + m_pLbColorTo->SetSelectHdl( aLink2 ); m_pBtnLoad->SetClickHdl( LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) ); @@ -244,7 +245,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) m_pLbGradients->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); *m_pPageType = PT_GRADIENT; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -373,7 +374,7 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) void SvxGradientTabPage::Reset( const SfxItemSet* ) { // m_pLbGradients->SelectEntryPos( 0 ); - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); // determine state of the buttons if( m_pGradientList->Count() ) @@ -400,6 +401,10 @@ VclPtr<SfxTabPage> SvxGradientTabPage::Create( vcl::Window* pWindow, +IMPL_LINK_TYPED( SvxGradientTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ModifiedHdl_Impl(&rListBox); +} IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) { css::awt::GradientStyle eXGS = (css::awt::GradientStyle) m_pLbGradientType->GetSelectEntryPos(); @@ -517,7 +522,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) *m_pnGradientListState |= ChangeType::MODIFIED; - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); } // determine button state @@ -614,7 +619,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); *m_pnGradientListState |= ChangeType::MODIFIED; } @@ -803,7 +808,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickSaveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ChangeGradientHdl_Impl, ListBox&, void) { std::unique_ptr<XGradient> pGradient; int nPos = m_pLbGradients->GetSelectEntryPos(); @@ -872,7 +877,6 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) m_pCtlPreview->Invalidate(); } - return 0L; } diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index d528bd85dc93..2c6928c46ccc 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -117,10 +117,11 @@ SvxHatchTabPage::SvxHatchTabPage m_pLbHatchings->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) ); Link<> aLink = LINK( this, SvxHatchTabPage, ModifiedHdl_Impl ); + Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); m_pMtrDistance->SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink ); - m_pLbLineType->SetSelectHdl( aLink ); - m_pLbLineColor->SetSelectHdl( aLink ); + m_pLbLineType->SetSelectHdl( aLink2 ); + m_pLbLineColor->SetSelectHdl( aLink2 ); m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); m_pBtnModify->SetClickHdl( @@ -221,7 +222,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbHatchings->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); *m_pPageType = PT_HATCH; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -334,7 +335,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) void SvxHatchTabPage::Reset( const SfxItemSet* rSet ) { - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); // determine button state if( m_pHatchingList->Count() ) @@ -366,6 +367,10 @@ VclPtr<SfxTabPage> SvxHatchTabPage::Create( vcl::Window* pWindow, +IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ModifiedHdl_Impl(&rListBox); +} IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) { if( p == m_pMtrAngle ) @@ -399,7 +404,7 @@ IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) -IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void) { std::unique_ptr<XHatch> pHatch; int nPos = m_pLbHatchings->GetSelectEntryPos(); @@ -466,8 +471,6 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl) m_pLbLineType->SaveValue(); m_pLbLineColor->SaveValue(); m_pLbHatchings->SaveValue(); - - return 0L; } @@ -554,7 +557,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) *m_pnHatchingListState |= ChangeType::MODIFIED; - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); } // determine button state @@ -651,7 +654,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); *m_pnHatchingListState |= ChangeType::MODIFIED; } diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 5c2227d13cbb..640b30bb84ff 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -183,24 +183,22 @@ SvxLineTabPage::SvxLineTabPage m_ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH ); m_pLbLineStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ClickInvisibleHdl_Impl ) ); - m_pLbColor->SetSelectHdl( LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); - m_pMtrLineWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); + m_pLbColor->SetSelectHdl( LINK( this, SvxLineTabPage, ChangePreviewListBoxHdl_Impl ) ); + m_pMtrLineWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangePreviewModifyHdl_Impl ) ); m_pMtrTransparent->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl ) ); - Link<> aStart = LINK( this, SvxLineTabPage, ChangeStartHdl_Impl ); - Link<> aEnd = LINK( this, SvxLineTabPage, ChangeEndHdl_Impl ); - m_pLbStartStyle->SetSelectHdl( aStart ); - m_pLbEndStyle->SetSelectHdl( aEnd ); - m_pMtrStartWidth->SetModifyHdl( aStart ); - m_pMtrEndWidth->SetModifyHdl( aEnd ); + m_pLbStartStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ChangeStartListBoxHdl_Impl ) ); + m_pLbEndStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ChangeEndListBoxHdl_Impl ) ); + m_pMtrStartWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeStartModifyHdl_Impl ) ); + m_pMtrEndWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeEndModifyHdl_Impl ) ); m_pTsbCenterStart->SetClickHdl( LINK( this, SvxLineTabPage, ChangeStartClickHdl_Impl ) ); m_pTsbCenterEnd->SetClickHdl( LINK( this, SvxLineTabPage, ChangeEndClickHdl_Impl ) ); - Link<> aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); + Link<ListBox&,void> aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); m_pLBEdgeStyle->SetSelectHdl( aEdgeStyle ); // LineCaps - Link<> aCapStyle = LINK( this, SvxLineTabPage, ChangeCapStyleHdl_Impl ); + Link<ListBox&,void> aCapStyle = LINK( this, SvxLineTabPage, ChangeCapStyleHdl_Impl ); m_pLBCapStyle->SetSelectHdl( aCapStyle ); // Symbols on a line (eg star charts), MB-handler set @@ -643,13 +641,13 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) if( m_nPageType == 2 ) // 1 { m_pLbLineStyle->SelectEntryPos( *m_pPosDashLb + 2 ); // +2 due to SOLID and INVLISIBLE - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } if( m_nPageType == 3 ) { m_pLbStartStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID m_pLbEndStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } } @@ -670,7 +668,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbColor->SelectEntryPos( nColorPos ); - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } m_nPageType = 0; @@ -1510,7 +1508,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) // LineCaps m_pLBCapStyle->SaveValue(); - ClickInvisibleHdl_Impl( this ); + ClickInvisibleHdl_Impl( *m_pLbLineStyle ); ChangePreviewHdl_Impl( NULL ); } @@ -1524,8 +1522,16 @@ VclPtr<SfxTabPage> SvxLineTabPage::Create( vcl::Window* pWindow, } - -IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangePreviewHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangePreviewModifyHdl_Impl, void *, pCntrl ) +{ + ChangePreviewHdl_Impl(pCntrl); + return 0; +} +void SvxLineTabPage::ChangePreviewHdl_Impl(void * pCntrl ) { if(pCntrl == m_pMtrLineWidth) { @@ -1582,8 +1588,6 @@ IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) const bool bHasLineEnd = m_pLbEndStyle->GetSelectEntryPos() != 0; m_pBoxEnd->Enable(bHasLineEnd && bHasLineStyle); - - return 0L; } @@ -1592,7 +1596,16 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartClickHdl_Impl, Button*, p, void ) { ChangeStartHdl_Impl(p); } -IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangeStartHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangeStartModifyHdl_Impl, void *, p ) +{ + ChangeStartHdl_Impl(p); + return 0; +} +void SvxLineTabPage::ChangeStartHdl_Impl( void * p ) { if( m_pCbxSynchronize->IsChecked() ) { @@ -1604,32 +1617,26 @@ IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) m_pTsbCenterEnd->SetState( m_pTsbCenterStart->GetState() ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } -IMPL_LINK_NOARG(SvxLineTabPage, ChangeEdgeStyleHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineTabPage, ChangeEdgeStyleHdl_Impl, ListBox&, void) { - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } // fdo#43209 -IMPL_LINK_NOARG( SvxLineTabPage, ChangeCapStyleHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SvxLineTabPage, ChangeCapStyleHdl_Impl, ListBox&, void ) { - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } -IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineTabPage, ClickInvisibleHdl_Impl, ListBox&, void) { if( m_pLbLineStyle->GetSelectEntryPos() == 0 ) // invisible { @@ -1658,9 +1665,7 @@ IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl) m_pGridEdgeCaps->Enable(); } } - ChangePreviewHdl_Impl( NULL ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } @@ -1669,7 +1674,16 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndClickHdl_Impl, Button*, p, void ) { ChangeEndHdl_Impl(p); } -IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangeEndHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangeEndModifyHdl_Impl, void *, p ) +{ + ChangeEndHdl_Impl(p); + return 0; +} +void SvxLineTabPage::ChangeEndHdl_Impl( void * p ) { if( m_pCbxSynchronize->IsChecked() ) { @@ -1681,9 +1695,7 @@ IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) m_pTsbCenterStart->SetState( m_pTsbCenterEnd->GetState() ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 176a6657b71c..2107aef63627 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -131,7 +131,7 @@ SvxLineDefTabPage::SvxLineDefTabPage m_pNumFldNumber1->SetModifyHdl( LINK( this, SvxLineDefTabPage, ChangeNumber1Hdl_Impl ) ); m_pNumFldNumber2->SetModifyHdl( LINK( this, SvxLineDefTabPage, ChangeNumber2Hdl_Impl ) ); - m_pLbLineStyles->SetSelectHdl( LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) ); + m_pLbLineStyles->SetSelectHdl( LINK( this, SvxLineDefTabPage, SelectLinestyleListBoxHdl_Impl ) ); // #i122042# switch off default adding of 'none' and 'solid' entries // for this ListBox; we want to select only editable/dashed styles @@ -141,13 +141,13 @@ SvxLineDefTabPage::SvxLineDefTabPage m_pCbxSynchronize->SetClickHdl( LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) ); // preview must be updated when there's something changed - Link<> aLink = LINK( this, SvxLineDefTabPage, SelectTypeHdl_Impl ); + Link<ListBox&, void> aLink = LINK( this, SvxLineDefTabPage, SelectTypeListBoxHdl_Impl ); m_pLbType1->SetSelectHdl( aLink ); m_pLbType2->SetSelectHdl( aLink ); - aLink = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); - m_pMtrLength1->SetModifyHdl( aLink ); - m_pMtrLength2->SetModifyHdl( aLink ); - m_pMtrDistance->SetModifyHdl( aLink ); + Link<> aLink2 = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); + m_pMtrLength1->SetModifyHdl( aLink2 ); + m_pMtrLength2->SetModifyHdl( aLink2 ); + m_pMtrDistance->SetModifyHdl( aLink2 ); pDashList = NULL; } @@ -198,7 +198,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& ) m_pLbLineStyles->SelectEntryPos( *pPosDashLb ); } // so that a possibly existing line style is discarded - SelectLinestyleHdl_Impl( this ); + SelectLinestyleHdl_Impl( nullptr ); // determining (and possibly cutting) the name // and displaying it in the GroupBox @@ -355,7 +355,12 @@ VclPtr<SfxTabPage> SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxIte -IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineDefTabPage, SelectLinestyleListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + SelectLinestyleHdl_Impl(&rListBox); +} + +void SvxLineDefTabPage::SelectLinestyleHdl_Impl(ListBox* p) { if(pDashList->Count()) { @@ -384,7 +389,6 @@ IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p ) if( p ) *pPageType = 2; } - return 0L; } @@ -506,7 +510,12 @@ IMPL_LINK_TYPED( SvxLineDefTabPage, ChangeMetricHdl_Impl, Button*, p, void ) -IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineDefTabPage, SelectTypeListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + SelectTypeHdl_Impl(&rListBox); +} + +void SvxLineDefTabPage::SelectTypeHdl_Impl(ListBox* p) { if ( p == m_pLbType1 || !p ) { @@ -536,7 +545,6 @@ IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p ) } } ChangePreviewHdl_Impl( p ); - return 0L; } @@ -715,7 +723,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickDeleteHdl_Impl, Button*, void) m_pLbLineStyles->RemoveEntry( nPos ); m_pLbLineStyles->SelectEntryPos( 0 ); - SelectLinestyleHdl_Impl( this ); + SelectLinestyleHdl_Impl( nullptr ); *pPageType = 0; // style should not be taken *pnDashListState |= ChangeType::MODIFIED; diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 3b4e7eaa58e0..e0157ccc0bb9 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -168,7 +168,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& ) if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND ) { m_pLbLineEnds->SelectEntryPos( *pPosLineEndLb ); - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); } INetURLObject aURL( pLineEndList->GetPath() ); @@ -285,7 +285,7 @@ VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const Sfx -IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, void) { if( pLineEndList->Count() > 0 ) { @@ -307,7 +307,6 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) // if there is an entry selected in the ListBox *pPageType = 3; } - return 0L; } @@ -489,7 +488,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void) *pnLineEndListState |= ChangeType::MODIFIED; - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); } else { @@ -530,7 +529,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void) m_pLbLineEnds->RemoveEntry( nPos ); m_pLbLineEnds->SelectEntryPos( 0 ); - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); *pPageType = 0; // LineEnd shall not be taken over *pnLineEndListState |= ChangeType::MODIFIED; diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 13f119f5eafa..4722406423b8 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -160,8 +160,8 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA //aCtlXRectPreview.SetFillAttr( aXFillAttr ); m_pTsbShowShadow->SetClickHdl( LINK( this, SvxShadowTabPage, ClickShadowHdl_Impl ) ); + m_pLbShadowColor->SetSelectHdl( LINK( this, SvxShadowTabPage, SelectShadowHdl_Impl ) ); Link<> aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl ); - m_pLbShadowColor->SetSelectHdl( aLink ); m_pMtrTransparent->SetModifyHdl( aLink ); m_pMtrDistance->SetModifyHdl( aLink ); } @@ -509,6 +509,10 @@ IMPL_LINK_NOARG_TYPED(SvxShadowTabPage, ClickShadowHdl_Impl, Button*, void) +IMPL_LINK_TYPED(SvxShadowTabPage, SelectShadowHdl_Impl, ListBox&, rListBox, void) +{ + ModifyShadowHdl_Impl(&rListBox); +} IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl) { if( m_pTsbShowShadow->GetState() == TRISTATE_TRUE ) |