summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-30 10:20:00 +0200
commit3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch)
treebdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /framework
parent57d254d42b6e1d836bd21e6fb2e968af2b511c7d (diff)
Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and return types, but provide default template arguments that keep the generic, unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the Link class can be updated over time. All the related macros are duplicated with ..._TYPED counterparts, that additionally take the RetType (except for LINK_TYPED, which manages to infer the relevant types from the supplied Member). (It would have been attractive to change the "untyped" LinkStubs from taking a void* to a properly typed ArgType parameter, too, but that would cause -fsanitize=function to flag uses of "untyped" Link::Call.) Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/classes/fwktabwindow.hxx4
-rw-r--r--framework/source/classes/fwktabwindow.cxx4
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx2
-rw-r--r--framework/source/services/substitutepathvars.cxx6
-rw-r--r--framework/source/uielement/toolbarmanager.cxx6
5 files changed, 11 insertions, 11 deletions
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx
index ed3d82c80e2c..3e39087c2445 100644
--- a/framework/inc/classes/fwktabwindow.hxx
+++ b/framework/inc/classes/fwktabwindow.hxx
@@ -112,8 +112,8 @@ public:
virtual ~FwkTabWindow();
virtual void dispose() SAL_OVERRIDE;
- void AddEventListener( const Link& rEventListener );
- void RemoveEventListener( const Link& rEventListener );
+ void AddEventListener( const Link<>& rEventListener );
+ void RemoveEventListener( const Link<>& rEventListener );
FwkTabPage* AddTabPage( sal_Int32 nIndex, const css::uno::Sequence< css::beans::NamedValue >& rProperties );
void ActivatePage( sal_Int32 nIndex );
void RemovePage( sal_Int32 nIndex );
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index da2c187e9f68..605b7b18b3cf 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -284,12 +284,12 @@ IMPL_LINK_NOARG(FwkTabWindow, DeactivatePageHdl)
return 1;
}
-void FwkTabWindow::AddEventListener( const Link& rEventListener )
+void FwkTabWindow::AddEventListener( const Link<>& rEventListener )
{
m_aTabCtrl->AddEventListener( rEventListener );
}
-void FwkTabWindow::RemoveEventListener( const Link& rEventListener )
+void FwkTabWindow::RemoveEventListener( const Link<>& rEventListener )
{
m_aTabCtrl->RemoveEventListener( rEventListener );
}
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 6ccaf62f89e6..753ca212fd28 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2677,7 +2677,7 @@ throw( uno::RuntimeException, std::exception )
m_bMustDoLayout = true;
if ( !m_aAsyncLayoutTimer.IsActive() )
{
- const Link& aLink = m_aAsyncLayoutTimer.GetTimeoutHdl();
+ const Link<>& aLink = m_aAsyncLayoutTimer.GetTimeoutHdl();
if ( aLink.IsSet() )
aLink.Call( &m_aAsyncLayoutTimer );
}
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index a1ab63726d03..bb02d348884c 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -114,7 +114,7 @@ typedef std::vector< SubstituteRule > SubstituteRuleVector;
class SubstitutePathVariables_Impl : public utl::ConfigItem
{
public:
- SubstitutePathVariables_Impl( const Link& aNotifyLink );
+ SubstitutePathVariables_Impl( const Link<>& aNotifyLink );
virtual ~SubstitutePathVariables_Impl();
static OperatingSystem GetOperatingSystemFromString( const OUString& );
@@ -153,7 +153,7 @@ class SubstitutePathVariables_Impl : public utl::ConfigItem
bool m_bHostRetrieved;
OUString m_aHost;
- Link m_aListenerNotify;
+ Link<> m_aListenerNotify;
const OUString m_aSharePointsNodeName;
const OUString m_aDirPropertyName;
const OUString m_aEnvPropertyName;
@@ -395,7 +395,7 @@ EnvironmentType SubstitutePathVariables_Impl::GetEnvTypeFromString( const OUStri
return ET_UNKNOWN;
}
-SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link& aNotifyLink ) :
+SubstitutePathVariables_Impl::SubstitutePathVariables_Impl( const Link<>& aNotifyLink ) :
utl::ConfigItem( OUString( "Office.Substitution" )),
m_bYPDomainRetrieved( false ),
m_bDNSDomainRetrieved( false ),
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index a517806eb6f4..326d55ea8c3e 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -276,7 +276,7 @@ void ToolBarManager::Destroy()
// #i93173# delete toolbar lazily as we can still be in one of its handlers
m_pToolBar->doLazyDelete();
- Link aEmpty;
+ Link<> aEmpty;
m_pToolBar->SetSelectHdl( aEmpty );
m_pToolBar->SetActivateHdl( aEmpty );
m_pToolBar->SetDeactivateHdl( aEmpty );
@@ -1807,8 +1807,8 @@ IMPL_LINK( ToolBarManager, Command, CommandEvent*, pCmdEvt )
if (pManagerMenu)
{
// Unlink our listeners again -- see above for why.
- pManagerMenu->SetSelectHdl( Link() );
- pManagerMenu->SetDeactivateHdl( Link() );
+ pManagerMenu->SetSelectHdl( Link<>() );
+ pManagerMenu->SetDeactivateHdl( Link<>() );
}
}