summaryrefslogtreecommitdiff
path: root/extensions
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 /extensions
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 'extensions')
-rw-r--r--extensions/source/abpilot/abspilot.cxx2
-rw-r--r--extensions/source/abpilot/typeselectionpage.cxx2
-rw-r--r--extensions/source/bibliography/datman.cxx2
-rw-r--r--extensions/source/bibliography/toolbar.cxx2
-rw-r--r--extensions/source/bibliography/toolbar.hxx4
-rw-r--r--extensions/source/plugin/inc/plugin/unx/mediator.hxx12
-rw-r--r--extensions/source/plugin/unx/npwrap.cxx2
-rw-r--r--extensions/source/propctrlr/browserview.hxx6
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx2
-rw-r--r--extensions/source/propctrlr/formlinkdialog.cxx4
-rw-r--r--extensions/source/propctrlr/propertyeditor.hxx6
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.cxx6
-rw-r--r--extensions/source/propctrlr/sqlcommanddesign.cxx2
-rw-r--r--extensions/source/propctrlr/sqlcommanddesign.hxx4
-rw-r--r--extensions/source/propctrlr/standardcontrol.hxx8
-rw-r--r--extensions/source/scanner/sane.hxx8
-rw-r--r--extensions/source/scanner/sanedlg.hxx2
-rw-r--r--extensions/source/scanner/scanwin.cxx6
-rw-r--r--extensions/source/update/ui/updatecheckui.cxx4
19 files changed, 42 insertions, 42 deletions
diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index 2617e35d7f6a..9dd84a1a0041 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -188,7 +188,7 @@ namespace abp
implCleanup();
// reset the click hdl
- m_pCancel->SetClickHdl( Link() );
+ m_pCancel->SetClickHdl( Link<>() );
// simulate the click again - this time, the default handling of the button will strike ....
m_pCancel->Click();
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index f93957962ff9..a282abe51e7c 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -133,7 +133,7 @@ namespace abp
m_aAllTypes.push_back( ButtonItem( m_pOE, AST_OE, bWithMozilla ) );
m_aAllTypes.push_back( ButtonItem( m_pOther, AST_OTHER, true ) );
- Link aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected );
+ Link<> aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected );
for ( ::std::vector< ButtonItem >::const_iterator loop = m_aAllTypes.begin();
loop != m_aAllTypes.end(); ++loop )
{
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index b6681c756320..8f5871cd1549 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -348,7 +348,7 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa
aListBoxes[0]->InsertEntry(pNames[nField]);
}
- Link aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl);
+ Link<> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl);
aListBoxes[0]->SelectEntryPos(0);
aListBoxes[0]->SetSelectHdl(aLnk);
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index f6db18010275..717591d65f3f 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -176,7 +176,7 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw
}
}
-BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle):
+BibToolBar::BibToolBar(vcl::Window* pParent, Link<> aLink, WinBits nStyle):
ToolBox(pParent,BibResId(RID_BIB_TOOLBAR)),
aImgLst(BibResId( RID_TOOLBAR_IMGLIST )),
aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )),
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index f7eef64155bd..8e36b56026b9 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -123,7 +123,7 @@ class BibToolBar: public ToolBox
sal_uInt16 nMenuId;
sal_uInt16 nSelMenuItem;
OUString aQueryField;
- Link aLayoutManager;
+ Link<> aLayoutManager;
sal_Int16 nSymbolsSize;
sal_Int16 nOutStyle;
@@ -148,7 +148,7 @@ class BibToolBar: public ToolBox
public:
- BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle = WB_3DLOOK );
+ BibToolBar(vcl::Window* pParent, Link<> aLink, WinBits nStyle = WB_3DLOOK );
virtual ~BibToolBar();
virtual void dispose() SAL_OVERRIDE;
diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx
index 7681831adbc6..ee4787c3994a 100644
--- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx
+++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx
@@ -98,8 +98,8 @@ protected:
// will be constantly increased with each message sent
bool m_bValid;
- Link m_aConnectionLostHdl;
- Link m_aNewMessageHdl;
+ Link<> m_aConnectionLostHdl;
+ Link<> m_aNewMessageHdl;
public:
Mediator( int nSocket );
virtual ~Mediator();
@@ -132,16 +132,16 @@ public:
MediatorMessage* GetNextMessage( bool bWait = false );
- Link SetConnectionLostHdl( const Link& rLink )
+ Link<> SetConnectionLostHdl( const Link<>& rLink )
{
- Link aRet = m_aConnectionLostHdl;
+ Link<> aRet = m_aConnectionLostHdl;
m_aConnectionLostHdl = rLink;
return aRet;
}
- Link SetNewMessageHdl( const Link& rLink )
+ Link<> SetNewMessageHdl( const Link<>& rLink )
{
- Link aRet = m_aNewMessageHdl;
+ Link<> aRet = m_aNewMessageHdl;
m_aNewMessageHdl = rLink;
return aRet;
}
diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx
index cec4fe7d1a05..59eb02798d13 100644
--- a/extensions/source/plugin/unx/npwrap.cxx
+++ b/extensions/source/plugin/unx/npwrap.cxx
@@ -399,7 +399,7 @@ int main( int argc, char **argv)
#endif
pConnector = new PluginConnector( nSocket );
- pConnector->SetConnectionLostHdl( Link( NULL, GlobalConnectionLostHdl ) );
+ pConnector->SetConnectionLostHdl( Link<>( NULL, GlobalConnectionLostHdl ) );
XtSetLanguageProc( NULL, NULL, NULL );
diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx
index 9ae97d364295..59e687149a89 100644
--- a/extensions/source/propctrlr/browserview.hxx
+++ b/extensions/source/propctrlr/browserview.hxx
@@ -39,7 +39,7 @@ namespace pcr
{
VclPtr<OPropertyEditor> m_pPropBox;
sal_uInt16 m_nActivePage;
- Link m_aPageActivationHandler;
+ Link<> m_aPageActivationHandler;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -58,8 +58,8 @@ namespace pcr
sal_uInt16 getActivaPage() const { return m_nActivePage; }
void activatePage(sal_uInt16 _nPage);
- void setPageActivationHandler(const Link& _rHdl) { m_aPageActivationHandler = _rHdl; }
- Link getPageActivationHandler() const { return m_aPageActivationHandler; }
+ void setPageActivationHandler(const Link<>& _rHdl) { m_aPageActivationHandler = _rHdl; }
+ Link<> getPageActivationHandler() const { return m_aPageActivationHandler; }
::com::sun::star::awt::Size getMinimumSize();
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index a13fd939a3dc..63744f858d1a 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -567,7 +567,7 @@ namespace pcr
else
{
INetURLObject aDocURL( impl_getDocumentURL_nothrow() );
- aPropertyValue <<= URIHelper::SmartRel2Abs( aDocURL, sControlValue, Link(), false, true, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI );
+ aPropertyValue <<= URIHelper::SmartRel2Abs( aDocURL, sControlValue, Link<>(), false, true, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI );
}
}
break;
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index 3689a775c961..18219bfdf60c 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -68,14 +68,14 @@ namespace pcr
VclPtr<ComboBox> m_pDetailColumn;
VclPtr<ComboBox> m_pMasterColumn;
- Link m_aLinkChangeHandler;
+ Link<> m_aLinkChangeHandler;
public:
FieldLinkRow( vcl::Window* _pParent );
virtual ~FieldLinkRow();
virtual void dispose() SAL_OVERRIDE;
- inline void SetLinkChangeHandler( const Link& _rHdl ) { m_aLinkChangeHandler = _rHdl; }
+ inline void SetLinkChangeHandler( const Link<>& _rHdl ) { m_aLinkChangeHandler = _rHdl; }
enum LinkParticipant
{
diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index 3a868386d7b0..cd519b8c2ff2 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -57,7 +57,7 @@ namespace pcr
IPropertyLineListener* m_pListener;
IPropertyControlObserver* m_pObserver;
sal_uInt16 m_nNextId;
- Link m_aPageActivationHandler;
+ Link<> m_aPageActivationHandler;
bool m_bHasHelpSection;
sal_Int32 m_nMinHelpLines;
sal_Int32 m_nMaxHelpLines;
@@ -107,8 +107,8 @@ namespace pcr
void RemoveEntry( const OUString& _rName );
void ChangeEntry( const OLineDescriptor& );
- void setPageActivationHandler(const Link& _rHdl) { m_aPageActivationHandler = _rHdl; }
- Link getPageActivationHandler() const { return m_aPageActivationHandler; }
+ void setPageActivationHandler(const Link<>& _rHdl) { m_aPageActivationHandler = _rHdl; }
+ Link<> getPageActivationHandler() const { return m_aPageActivationHandler; }
// #95343# -------------------------------
sal_Int32 getMinimumWidth();
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 43f372deecc1..0d5b30dee61d 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -250,7 +250,7 @@ namespace pcr
if (pData)
m_xSelectedControl = Reference< XPropertySet > (*static_cast<Reference< XPropertySet > *>(pData));
- m_pNoAssignment->SetClickHdl(Link());
+ m_pNoAssignment->SetClickHdl(Link<>());
m_pNoAssignment->Check(pData == NULL);
m_pNoAssignment->SetClickHdl(LINK(this, OSelectLabelDialog, OnNoAssignmentClicked));
@@ -286,8 +286,8 @@ namespace pcr
if (m_pLastSelected)
{
- m_pControlTree->SetSelectHdl(Link());
- m_pControlTree->SetDeselectHdl(Link());
+ m_pControlTree->SetSelectHdl(Link<>());
+ m_pControlTree->SetDeselectHdl(Link<>());
m_pControlTree->Select(m_pLastSelected, !m_pNoAssignment->IsChecked());
m_pControlTree->SetSelectHdl(LINK(this, OSelectLabelDialog, OnEntrySelected));
m_pControlTree->SetDeselectHdl(LINK(this, OSelectLabelDialog, OnEntrySelected));
diff --git a/extensions/source/propctrlr/sqlcommanddesign.cxx b/extensions/source/propctrlr/sqlcommanddesign.cxx
index eca0375a552e..753ab0eea7f9 100644
--- a/extensions/source/propctrlr/sqlcommanddesign.cxx
+++ b/extensions/source/propctrlr/sqlcommanddesign.cxx
@@ -100,7 +100,7 @@ namespace pcr
SQLCommandDesigner::SQLCommandDesigner( const Reference< XComponentContext >& _rxContext,
const ::rtl::Reference< ISQLCommandAdapter >& _rxPropertyAdapter,
- const ::dbtools::SharedConnection& _rConnection, const Link& _rCloseLink )
+ const ::dbtools::SharedConnection& _rConnection, const Link<>& _rCloseLink )
:m_xContext( _rxContext )
,m_xConnection( _rConnection )
,m_xObjectAdapter( _rxPropertyAdapter )
diff --git a/extensions/source/propctrlr/sqlcommanddesign.hxx b/extensions/source/propctrlr/sqlcommanddesign.hxx
index ab1ab945d846..41bb74e5e85f 100644
--- a/extensions/source/propctrlr/sqlcommanddesign.hxx
+++ b/extensions/source/propctrlr/sqlcommanddesign.hxx
@@ -55,7 +55,7 @@ namespace pcr
::dbtools::SharedConnection m_xConnection;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > m_xDesigner;
::rtl::Reference< ISQLCommandAdapter > m_xObjectAdapter;
- Link m_aCloseLink;
+ Link<> m_aCloseLink;
public:
/** creates the instance, and immediately opens the SQL command design frame
@@ -76,7 +76,7 @@ namespace pcr
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
const ::rtl::Reference< ISQLCommandAdapter >& _rxPropertyAdapter,
const ::dbtools::SharedConnection& _rConnection,
- const Link& _rCloseLink
+ const Link<>& _rCloseLink
);
/** determines whether the SQL Command designer is currently active, i.e.
diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx
index 9eb99354abda..aa8e6aff5fd9 100644
--- a/extensions/source/propctrlr/standardcontrol.hxx
+++ b/extensions/source/propctrlr/standardcontrol.hxx
@@ -63,7 +63,7 @@ namespace pcr
{
}
- void SetModifyHdl( const Link& _rLink ) { ListBoxType::SetSelectHdl( _rLink ); }
+ void SetModifyHdl( const Link<>& _rLink ) { ListBoxType::SetSelectHdl( _rLink ); }
protected:
bool PreNotify( NotifyEvent& _rNEvt );
@@ -166,7 +166,7 @@ namespace pcr
{
private:
Point m_aMouseButtonDownPos;
- Link m_aClickHandler;
+ Link<> m_aClickHandler;
public:
HyperlinkInput( vcl::Window* _pParent, WinBits _nWinStyle );
@@ -174,8 +174,8 @@ namespace pcr
/** sets the handler which will (asynchronously, with locked SolarMutex) be called
when the hyperlink has been clicked by the user
*/
- void SetClickHdl( const Link& _rHdl ) { m_aClickHandler = _rHdl; }
- const Link& GetClickHdl( ) const { return m_aClickHandler; }
+ void SetClickHdl( const Link<>& _rHdl ) { m_aClickHandler = _rHdl; }
+ const Link<>& GetClickHdl( ) const { return m_aClickHandler; }
protected:
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx
index 338e0df2a5aa..06687028a5e8 100644
--- a/extensions/source/scanner/sane.hxx
+++ b/extensions/source/scanner/sane.hxx
@@ -96,7 +96,7 @@ private:
int mnDevice;
SANE_Handle maHandle;
- Link maReloadOptionsLink;
+ Link<> maReloadOptionsLink;
static inline oslGenericFunction
LoadSymbol( const char* );
@@ -168,7 +168,7 @@ public:
bool Start( BitmapTransporter& );
- inline Link SetReloadOptionsHdl( const Link& rLink );
+ inline Link<> SetReloadOptionsHdl( const Link<>& rLink );
};
inline int Sane::GetOptionElements( int n )
@@ -181,9 +181,9 @@ inline int Sane::GetOptionElements( int n )
return 1;
}
-inline Link Sane::SetReloadOptionsHdl( const Link& rLink )
+inline Link<> Sane::SetReloadOptionsHdl( const Link<>& rLink )
{
- Link aRet = maReloadOptionsLink;
+ Link<> aRet = maReloadOptionsLink;
maReloadOptionsLink = rLink;
return aRet;
}
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index 6aca2733c3a7..7e689221f037 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -38,7 +38,7 @@ private:
Sane& mrSane;
bool mbScanEnabled;
- Link maOldLink;
+ Link<> maOldLink;
VclPtr<OKButton> mpOKButton;
VclPtr<CancelButton> mpCancelButton;
diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx
index 7eb6713bec6b..e6b053dd7ce2 100644
--- a/extensions/source/scanner/scanwin.cxx
+++ b/extensions/source/scanner/scanwin.cxx
@@ -83,7 +83,7 @@ class ImpTwain : public ::cppu::WeakImplHelper1< util::XCloseListener >
ScannerManager& mrMgr;
TW_IDENTITY aAppIdent;
TW_IDENTITY aSrcIdent;
- Link aNotifyLink;
+ Link<> aNotifyLink;
DSMENTRYPROC pDSM;
osl::Module* pMod;
ULONG_PTR nCurState;
@@ -116,7 +116,7 @@ class ImpTwain : public ::cppu::WeakImplHelper1< util::XCloseListener >
public:
- ImpTwain( ScannerManager& rMgr, const Link& rNotifyLink );
+ ImpTwain( ScannerManager& rMgr, const Link<>& rNotifyLink );
~ImpTwain();
void Destroy();
@@ -150,7 +150,7 @@ LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
}
// #107835# hold reference to ScannerManager, to prevent premature death
-ImpTwain::ImpTwain( ScannerManager& rMgr, const Link& rNotifyLink ) :
+ImpTwain::ImpTwain( ScannerManager& rMgr, const Link<>& rNotifyLink ) :
mxMgr( uno::Reference< scanner::XScannerManager >( static_cast< OWeakObject* >( &rMgr ), uno::UNO_QUERY) ),
mrMgr( rMgr ),
aNotifyLink( rNotifyLink ),
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index dea223223a1b..fcfd11afbeec 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -135,8 +135,8 @@ class UpdateCheckUI : public ::cppu::WeakImplHelper3
ResMgr* mpSfxResMgr;
Idle maWaitIdle;
Timer maTimeoutTimer;
- Link maWindowEventHdl;
- Link maApplicationEventHdl;
+ Link<> maWindowEventHdl;
+ Link<> maApplicationEventHdl;
bool mbShowBubble;
bool mbShowMenuIcon;
bool mbBubbleChanged;