summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-15 08:13:49 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-16 09:11:29 +0000
commit6f1313b3d44ea54e9a331e0fc00871081fa662fe (patch)
treefa6d9b6da04daedcb63ea2a0bc8c414288ed8bc6 /svtools
parent14bf708ef586b15dffed66ffaf524baf4d8fcbfa (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 'svtools')
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx24
-rw-r--r--svtools/source/control/filectrl.cxx4
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx11
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx3
-rw-r--r--svtools/source/filter/GraphicExportOptionsDialog.cxx12
-rw-r--r--svtools/source/filter/exportdialog.cxx12
-rw-r--r--svtools/source/filter/exportdialog.hxx8
-rw-r--r--svtools/source/inc/unoiface.hxx3
-rw-r--r--svtools/source/uno/unoiface.cxx15
9 files changed, 37 insertions, 55 deletions
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index d31eb22cdc34..f16c21e3eea6 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -80,6 +80,11 @@ namespace svt
GetComboBox().SetModifyHdl( LINK(this, ComboBoxCellController, ModifyHdl) );
}
+ IMPL_LINK_NOARG_TYPED(ComboBoxCellController, ModifyHdl, Edit&, void)
+ {
+ callModifyHdl();
+ }
+
bool ComboBoxCellController::MoveAllowed(const KeyEvent& rEvt) const
{
@@ -130,12 +135,6 @@ namespace svt
GetComboBox().SaveValue();
}
- IMPL_LINK_NOARG(ComboBoxCellController, ModifyHdl)
- {
- callModifyHdl();
- return 0;
- }
-
//= ListBoxControl
ListBoxControl::ListBoxControl(vcl::Window* pParent, WinBits nWinStyle)
:ListBox(pParent, nWinStyle|WB_DROPDOWN|WB_NOBORDER)
@@ -330,7 +329,8 @@ namespace svt
//= CheckBoxCellController
- CheckBoxCellController::CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin)
+ CheckBoxCellController::CheckBoxCellController(CheckBoxControl* pWin)
+ : CellController(pWin)
{
static_cast<CheckBoxControl &>(GetWindow()).SetModifyHdl( LINK(this, CheckBoxCellController, ModifyHdl) );
}
@@ -365,7 +365,6 @@ namespace svt
return 0;
}
-
//= MultiLineEditImplementation
@@ -451,13 +450,11 @@ namespace svt
}
- IMPL_LINK_NOARG(EditCellController, ModifyHdl)
+ IMPL_LINK_NOARG_TYPED(EditCellController, ModifyHdl, Edit&, void)
{
callModifyHdl();
- return 0;
}
-
//= SpinCellController
@@ -509,14 +506,11 @@ namespace svt
return GetSpinWindow().IsModified();
}
-
- IMPL_LINK_NOARG(SpinCellController, ModifyHdl)
+ IMPL_LINK_NOARG_TYPED(SpinCellController, ModifyHdl, Edit&, void)
{
callModifyHdl();
- return 0;
}
-
//= FormattedFieldCellController
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 0a64a2d95174..62c6172c60ff 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -196,7 +196,7 @@ void FileControl::GetFocus()
maEdit->GrabFocus();
}
-void FileControl::SetEditModifyHdl( const Link<>& rLink )
+void FileControl::SetEditModifyHdl( const Link<Edit&,void>& rLink )
{
if (!maEdit || maEdit->IsDisposed())
return;
@@ -244,7 +244,7 @@ void FileControl::ImplBrowseFile( )
if ( aObj.GetProtocol() == INetProtocol::File )
aNewText = aObj.PathToFileName();
SetText( aNewText );
- maEdit->GetModifyHdl().Call( maEdit.get() );
+ maEdit->GetModifyHdl().Call( *maEdit.get() );
}
}
}
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index eb0cbd1231b9..02f933cc5876 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -289,21 +289,18 @@ IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditHdl, DetailsContainer*, void )
m_pBTOk->Enable( !sName.isEmpty( ) && !sUrl.isEmpty( ) );
}
-IMPL_LINK_NOARG( PlaceEditDialog, ModifyHdl )
+IMPL_LINK_NOARG_TYPED( PlaceEditDialog, ModifyHdl, Edit&, void )
{
EditHdl(nullptr);
- return 1;
}
-IMPL_LINK_NOARG( PlaceEditDialog, EditLabelHdl )
+IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditLabelHdl, Edit&, void )
{
bLabelChanged = true;
EditHdl(NULL);
-
- return 1;
}
-IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
+IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditUsernameHdl, Edit&, void )
{
for ( std::vector< std::shared_ptr< DetailsContainer > >::iterator it = m_aDetailsContainers.begin( );
it != m_aDetailsContainers.end( ); ++it )
@@ -313,8 +310,6 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
}
EditHdl(NULL);
-
- return 1;
}
IMPL_LINK_NOARG_TYPED( PlaceEditDialog, SelectTypeHdl, ListBox&, void )
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 7943e65e446a..7e2aa397a622 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -80,10 +80,9 @@ void DetailsContainer::setActive( bool bActive )
m_bIsActive = bActive;
}
-IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl )
+IMPL_LINK_NOARG_TYPED( DetailsContainer, ValueChangeHdl, Edit&, void )
{
notifyChange( );
- return 0;
}
HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ) :
diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx
index 8277304d537c..b8a9723218be 100644
--- a/svtools/source/filter/GraphicExportOptionsDialog.cxx
+++ b/svtools/source/filter/GraphicExportOptionsDialog.cxx
@@ -62,35 +62,29 @@ void GraphicExportOptionsDialog::initialize()
mSize100mm = mRenderer.getDocumentSizeIn100mm(mCurrentPage);
}
-IMPL_LINK_NOARG( GraphicExportOptionsDialog, widthModifiedHandle )
+IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, widthModifiedHandle, Edit&, void )
{
mResolution = mpWidth->GetValue() / getViewWidthInch();
updateHeight();
updateResolution();
-
- return 0L;
}
-IMPL_LINK_NOARG( GraphicExportOptionsDialog, heightModifiedHandle )
+IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, heightModifiedHandle, Edit&, void )
{
mResolution = mpHeight->GetValue() / getViewHeightInch();
updateWidth();
updateResolution();
-
- return 0L;
}
-IMPL_LINK_NOARG( GraphicExportOptionsDialog, resolutionModifiedHandle )
+IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, resolutionModifiedHandle, Edit&, void )
{
mResolution = mpResolution->GetText().toInt32();
updateWidth();
updateHeight();
Update();
-
- return 0L;
}
double GraphicExportOptionsDialog::getViewWidthInch()
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index c1613961cdfd..06ef5f273c80 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -1028,10 +1028,9 @@ void ExportDialog::dispose()
|* stores values set in the ini-file
|*
\************************************************************************/
-IMPL_LINK_NOARG(ExportDialog, SelectHdl)
+IMPL_LINK_NOARG_TYPED(ExportDialog, SelectHdl, Edit&, void)
{
updateControls();
- return 0;
}
IMPL_LINK_NOARG_TYPED(ExportDialog, SelectListBoxHdl, ListBox&, void)
{
@@ -1042,7 +1041,7 @@ IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdl, Button*, void)
updateControls();
}
-IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX)
+IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlMtfSizeX, Edit&, void)
{
double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width;
@@ -1073,10 +1072,9 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX)
maSize.Height = aDest.Height();
}
updateControls();
- return 0;
}
-IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY)
+IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlMtfSizeY, Edit&, void)
{
double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height;
@@ -1107,10 +1105,9 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY)
maSize.Width = aDest.Width();
}
updateControls();
- return 0;
}
-IMPL_LINK_NOARG(ExportDialog, UpdateHdlNfResolution)
+IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlNfResolution, Edit&, void)
{
sal_Int32 nResolution = mpNfResolution->GetValue();
if ( mpLbResolution->GetSelectEntryPos() == 0 ) // pixels / cm
@@ -1121,7 +1118,6 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlNfResolution)
maResolution.Height= nResolution;
updateControls();
- return 0;
}
IMPL_LINK_NOARG_TYPED(ExportDialog, SbCompressionUpdateHdl, ScrollBar*, void)
diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx
index 603a18f1281c..ef16700632d5 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -144,10 +144,10 @@ private:
DECL_LINK_TYPED( UpdateHdl, Button*, void );
DECL_LINK_TYPED( SelectListBoxHdl, ListBox&, void );
- DECL_LINK( SelectHdl, void* );
- DECL_LINK( UpdateHdlMtfSizeX, void* );
- DECL_LINK( UpdateHdlMtfSizeY, void* );
- DECL_LINK( UpdateHdlNfResolution, void* );
+ DECL_LINK_TYPED( SelectHdl, Edit&, void );
+ DECL_LINK_TYPED( UpdateHdlMtfSizeX, Edit&, void );
+ DECL_LINK_TYPED( UpdateHdlMtfSizeY, Edit&, void );
+ DECL_LINK_TYPED( UpdateHdlNfResolution, Edit&, void );
DECL_LINK_TYPED( SbCompressionUpdateHdl, ScrollBar*, void );
DECL_LINK_TYPED( OK, Button*, void );
diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx
index 03ee585105f4..eaa53a942657 100644
--- a/svtools/source/inc/unoiface.hxx
+++ b/svtools/source/inc/unoiface.hxx
@@ -116,7 +116,8 @@ public:
class VCLXFileControl : ::com::sun::star::awt::XTextComponent, public ::com::sun::star::awt::XTextLayoutConstrains, public VCLXWindow
{
protected:
- DECL_LINK(ModifyHdl, void *);
+ DECL_LINK_TYPED(ModifyHdl, Edit&, void);
+ void ModifyHdl();
TextListenerMultiplexer maTextListeners;
public:
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 39e0497e4a04..2859c9b17991 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -545,7 +545,7 @@ VCLXFileControl::~VCLXFileControl()
{
VclPtr< FileControl > pControl = GetAs< FileControl >();
if ( pControl )
- pControl->GetEdit().SetModifyHdl( Link<>() );
+ pControl->GetEdit().SetModifyHdl( Link<Edit&,void>() );
}
::com::sun::star::uno::Any VCLXFileControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -595,7 +595,7 @@ void VCLXFileControl::SetWindow( const VclPtr< vcl::Window > &pWindow )
{
VclPtr< FileControl > pPrevFileControl = GetAsDynamic< FileControl >();
if ( pPrevFileControl )
- pPrevFileControl->SetEditModifyHdl( Link<>() );
+ pPrevFileControl->SetEditModifyHdl( Link<Edit&,void>() );
FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow.get() );
if ( pNewFileControl )
@@ -625,7 +625,7 @@ void VCLXFileControl::setText( const OUString& aText ) throw(::com::sun::star::u
// also in Java a textChanged is triggered, not in VCL.
// ::com::sun::star::awt::Toolkit should be JAVA-compliant...
- ModifyHdl( NULL );
+ ModifyHdl();
}
}
@@ -722,13 +722,16 @@ sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeE
}
-IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl)
+IMPL_LINK_NOARG_TYPED(VCLXFileControl, ModifyHdl, Edit&, void)
+{
+ ModifyHdl();
+}
+
+void VCLXFileControl::ModifyHdl()
{
::com::sun::star::awt::TextEvent aEvent;
aEvent.Source = static_cast<cppu::OWeakObject*>(this);
maTextListeners.textChanged( aEvent );
-
- return 1;
}
::com::sun::star::awt::Size VCLXFileControl::getMinimumSize() throw(::com::sun::star::uno::RuntimeException, std::exception)