diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-15 08:13:49 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-16 09:11:29 +0000 |
commit | 6f1313b3d44ea54e9a331e0fc00871081fa662fe (patch) | |
tree | fa6d9b6da04daedcb63ea2a0bc8c414288ed8bc6 /starmath | |
parent | 14bf708ef586b15dffed66ffaf524baf4d8fcbfa (diff) |
convert Link<> to typed
Change-Id: Icbba339dac0be31e30dff021bba06a219f8aecd6
Reviewed-on: https://gerrit.libreoffice.org/19405
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/dialog.hxx | 4 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 28 |
2 files changed, 15 insertions, 17 deletions
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 59a8f856584a..16cf98d3857e 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -103,7 +103,7 @@ class SmFontDialog : public ModalDialog vcl::Font maFont; DECL_LINK_TYPED(FontSelectHdl, ComboBox&, void); - DECL_LINK(FontModifyHdl, ComboBox *); + DECL_LINK_TYPED(FontModifyHdl, Edit&, void); DECL_LINK_TYPED(AttrChangeHdl, Button *, void); virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; @@ -436,7 +436,7 @@ class SmSymDefineDialog : public ModalDialog DECL_LINK_TYPED(OldSymbolChangeHdl, ComboBox&, void); DECL_LINK_TYPED(OldSymbolSetChangeHdl, ComboBox&, void); - DECL_LINK(ModifyHdl, ComboBox *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(FontChangeHdl, ListBox&, void); DECL_LINK_TYPED(SubsetChangeHdl, ListBox&, void); DECL_LINK_TYPED(StyleChangeHdl, ComboBox&, void); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b1d0bca9e333..6d58de60e762 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -301,15 +301,15 @@ IMPL_LINK_TYPED( SmFontDialog, FontSelectHdl, ComboBox&, rComboBox, void ) m_pShowFont->SetFont(maFont); } -IMPL_LINK( SmFontDialog, FontModifyHdl, ComboBox *, pComboBox ) +IMPL_LINK_TYPED( SmFontDialog, FontModifyHdl, Edit&, rEdit, void ) { + ComboBox& rComboBox = static_cast<ComboBox&>(rEdit); // if font is available in list then use it - sal_Int32 nPos = pComboBox->GetEntryPos( pComboBox->GetText() ); + sal_Int32 nPos = rComboBox.GetEntryPos( rComboBox.GetText() ); if (COMBOBOX_ENTRY_NOTFOUND != nPos) { - FontSelectHdl( *pComboBox ); + FontSelectHdl( rComboBox ); } - return 0; } IMPL_LINK_NOARG_TYPED( SmFontDialog, AttrChangeHdl, Button*, void ) @@ -1810,35 +1810,33 @@ IMPL_LINK_TYPED( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox&, rComboBox, } -IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) +IMPL_LINK_TYPED( SmSymDefineDialog, ModifyHdl, Edit&, rEdit, void ) { + ComboBox& rComboBox = static_cast<ComboBox&>(rEdit); // remember cursor position for later restoring of it - Selection aSelection (pComboBox->GetSelection()); + Selection aSelection (rComboBox.GetSelection()); - if (pComboBox == pSymbols) + if (&rComboBox == pSymbols) SelectSymbol(*pSymbols, pSymbols->GetText(), false); - else if (pComboBox == pSymbolSets) + else if (&rComboBox == pSymbolSets) SelectSymbolSet(*pSymbolSets, pSymbolSets->GetText(), false); - else if (pComboBox == pOldSymbols) + else if (&rComboBox == pOldSymbols) // allow only names from the list SelectSymbol(*pOldSymbols, pOldSymbols->GetText(), true); - else if (pComboBox == pOldSymbolSets) + else if (&rComboBox == pOldSymbolSets) // allow only names from the list SelectSymbolSet(*pOldSymbolSets, pOldSymbolSets->GetText(), true); - else if (pComboBox == pStyles) + else if (&rComboBox == pStyles) // allow only names from the list (that's the case here anyway) SelectStyle(pStyles->GetText(), true); else SAL_WARN("starmath", "wrong combobox argument"); - pComboBox->SetSelection(aSelection); + rComboBox.SetSelection(aSelection); UpdateButtons(); - - return 0; } - IMPL_LINK_TYPED( SmSymDefineDialog, FontChangeHdl, ListBox&, rListBox, void ) { (void) rListBox; |