diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-30 10:20:00 +0200 |
commit | 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed (patch) | |
tree | bdfd28afe5a452060e3d985c5f01b45f4b7bc2cd /dbaccess | |
parent | 57d254d42b6e1d836bd21e6fb2e968af2b511c7d (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 'dbaccess')
23 files changed, 87 insertions, 87 deletions
diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx b/dbaccess/source/ui/browser/AsynchronousLink.cxx index 6986a79b8452..8dd872f30ca8 100644 --- a/dbaccess/source/ui/browser/AsynchronousLink.cxx +++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx @@ -23,7 +23,7 @@ // OAsynchronousLink using namespace dbaui; -OAsynchronousLink::OAsynchronousLink( const Link& _rHandler ) +OAsynchronousLink::OAsynchronousLink( const Link<>& _rHandler ) :m_aHandler(_rHandler) ,m_aEventSafety() ,m_aDestructionSafety() diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index bc0b44194983..6d8feddfcf7e 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -63,12 +63,12 @@ void DBTreeView::dispose() vcl::Window::dispose(); } -void DBTreeView::SetPreExpandHandler(const Link& _rHdl) +void DBTreeView::SetPreExpandHandler(const Link<>& _rHdl) { m_pTreeListBox->SetPreExpandHandler(_rHdl); } -void DBTreeView::setCopyHandler(const Link& _rHdl) +void DBTreeView::setCopyHandler(const Link<>& _rHdl) { m_pTreeListBox->setCopyHandler(_rHdl); } @@ -86,7 +86,7 @@ void DBTreeView::setModel(SvTreeList* _pTreeModel) m_pTreeListBox->SetModel(_pTreeModel); } -void DBTreeView::setSelChangeHdl( const Link& _rHdl ) +void DBTreeView::setSelChangeHdl( const Link<>& _rHdl ) { m_pTreeListBox->SetSelChangeHdl( _rHdl ); } diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index 5313583fc061..a3d237dc8351 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -46,13 +46,13 @@ namespace dbaui <p>When calling the link, the parameter is an SvTreeListEntry marking the entry to be expanded. </p> */ - void SetPreExpandHandler(const Link& _rHdl); + void SetPreExpandHandler(const Link<>& _rHdl); /// gets the currently set NodeExpansionHandler - void setCopyHandler(const Link& _rHdl); + void setCopyHandler(const Link<>& _rHdl); void setModel(SvTreeList* _pTreeModel); - void setSelChangeHdl(const Link& _rHdl); + void setSelChangeHdl(const Link<>& _rHdl); DBTreeListBox& getListBox() const { return *m_pTreeListBox; } diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index f011e060a719..b7bdad487f80 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -460,7 +460,7 @@ namespace dbaui lateUIInit(); - Link aLink(LINK(this, OTableListBoxControl, OnTableChanged)); + Link<> aLink(LINK(this, OTableListBoxControl, OnTableChanged)); m_pLeftTable->SetSelectHdl(aLink); m_pRightTable->SetSelectHdl(aLink); } diff --git a/dbaccess/source/ui/control/ScrollHelper.cxx b/dbaccess/source/ui/control/ScrollHelper.cxx index a15fb7693d25..e463262b51b6 100644 --- a/dbaccess/source/ui/control/ScrollHelper.cxx +++ b/dbaccess/source/ui/control/ScrollHelper.cxx @@ -37,7 +37,7 @@ namespace dbaui Rectangle aScrollArea( Point(0, _rOutputSize.Height() - LISTBOX_SCROLLING_AREA), Size(_rOutputSize.Width(), LISTBOX_SCROLLING_AREA) ); - Link aToCall; + Link<> aToCall; // if pointer in bottom area begin scroll if( aScrollArea.IsInside(_rPoint) ) aToCall = m_aUpScroll; diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index c457c962c8fa..b01a1bb6a95a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -374,7 +374,7 @@ using namespace ::com::sun::star; OnModified( NULL ); } - Link MySQLNativeSetupPage::getControlModifiedLink() + Link<> MySQLNativeSetupPage::getControlModifiedLink() { return LINK( this, MySQLNativeSetupPage, OnModified ); } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 109c3f3c93d3..0f2c026a12ea 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -86,7 +86,7 @@ namespace dbaui OLDAPConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual ~OLDAPConnectionPageSetup(); virtual void dispose() SAL_OVERRIDE; - virtual Link getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); } + virtual Link<> getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); } protected: virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; @@ -127,7 +127,7 @@ namespace dbaui virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; - virtual Link getControlModifiedLink() SAL_OVERRIDE; + virtual Link<> getControlModifiedLink() SAL_OVERRIDE; private: DECL_LINK( OnModified, Edit* ); @@ -154,7 +154,7 @@ namespace dbaui virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE; virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; - virtual Link getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified); } + virtual Link<> getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified); } DECL_LINK(OnTestJavaClickHdl,PushButton*); DECL_LINK(OnEditModified,Edit*); @@ -217,9 +217,9 @@ namespace dbaui static VclPtr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet ); ConnectionType getMySQLMode(); - Link maClickHdl; - void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; } - const Link& GetClickHdl() const { return maClickHdl; } + Link<> maClickHdl; + void SetClickHdl( const Link<>& rLink ) { maClickHdl = rLink; } + const Link<>& GetClickHdl() const { return maClickHdl; } DECL_LINK(ImplClickHdl, OMySQLIntroPageSetup*); protected: @@ -285,7 +285,7 @@ namespace dbaui void enableTableWizardCheckBox( bool _bSupportsTableCreation); /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method> - Link getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OGenericAdministrationPage, OnControlModified); } + Link<> getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OGenericAdministrationPage, OnControlModified); } DECL_LINK(OnOpenSelected, CheckBox*); protected: diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index 56610e6e615b..c847fe4aee83 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -44,7 +44,7 @@ namespace dbaui { OTextConnectionHelper(); - Link m_aModifiedHandler; /// to be called if something on the page has been modified + Link<> m_aModifiedHandler; /// to be called if something on the page has been modified public: OTextConnectionHelper( vcl::Window* pParent, const short _nAvailableSections ); @@ -75,13 +75,13 @@ namespace dbaui OUString m_aTextSeparatorList; OUString m_aTextNone; OUString m_aOldExtension; - Link m_aGetExtensionHandler; /// to be called if a new type is selected + Link<> m_aGetExtensionHandler; /// to be called if a new type is selected short m_nAvailableSections; protected: void callModifiedHdl() const { if (m_aModifiedHandler.IsSet()) m_aModifiedHandler.Call((void*)this); } - Link getControlModifiedLink() { return LINK(this, OTextConnectionHelper, OnControlModified); } + Link<> getControlModifiedLink() { return LINK(this, OTextConnectionHelper, OnControlModified); } DECL_LINK(OnSetExtensionHdl,RadioButton*); DECL_LINK(OnControlModified,Control*); DECL_LINK(OnEditModified,Edit*); @@ -95,7 +95,7 @@ namespace dbaui void implInitControls(const SfxItemSet& _rSet, bool _bValid); void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); - void SetClickHandler(const Link& _rHandler) { m_aGetExtensionHandler = _rHandler; } + void SetClickHandler(const Link<>& _rHandler) { m_aGetExtensionHandler = _rHandler; } OUString GetExtension(); bool FillItemSet( SfxItemSet& rSet, const bool bChangedSomething ); bool prepareLeave(); diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index a4ff866067d7..a869c8220785 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -125,7 +125,7 @@ namespace dbaui }; // MySQLNativeSettings - MySQLNativeSettings::MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink ) + MySQLNativeSettings::MySQLNativeSettings( vcl::Window& _rParent, const Link<>& _rControlModificationLink ) :TabPage( &_rParent, "MysqlNativeSettings", "dbaccess/ui/mysqlnativesettings.ui" ) { get(m_pDatabaseNameLabel, "dbnamelabel"); diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index 544ef8b89a24..c4e805cd6fc2 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -52,7 +52,7 @@ namespace dbaui m_aControlDependencies; public: - MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink ); + MySQLNativeSettings( vcl::Window& _rParent, const Link<>& _rControlModificationLink ); virtual ~MySQLNativeSettings(); virtual void dispose() SAL_OVERRIDE; void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 3572cd860055..74cc29c3d39c 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -93,7 +93,7 @@ namespace dbaui ,public ::svt::IWizardPageController { private: - Link m_aModifiedHandler; /// to be called if something on the page has been modified + Link<> m_aModifiedHandler; /// to be called if something on the page has been modified bool m_abEnableRoadmap; protected: IDatabaseSettingsDialog* m_pAdminDialog; @@ -104,7 +104,7 @@ namespace dbaui public: OGenericAdministrationPage(vcl::Window* _pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rAttrSet); /// set a handler which gets called every time something on the page has been modified - void SetModifiedHandler(const Link& _rHandler) { m_aModifiedHandler = _rHandler; } + void SetModifiedHandler(const Link<>& _rHandler) { m_aModifiedHandler = _rHandler; } /** Sets the ParentDialog @param _pAdminDialog @@ -234,7 +234,7 @@ namespace dbaui DECL_LINK(OnTestConnectionClickHdl, PushButton*); /// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method> - virtual Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); } + virtual Link<> getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); } }; // ControlRelation diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 6c5d3294f749..1750b4188c26 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -49,7 +49,7 @@ namespace dbaui }; SPECIAL_MESSAGE m_eLastMessage; - Link m_aTypeSelectHandler; /// to be called if a new type is selected + Link<> m_aTypeSelectHandler; /// to be called if a new type is selected bool m_bDisplayingInvalid : 1; /// the currently displayed data source is deleted bool m_bInitTypeList : 1; bool approveDatasourceType( const OUString& _sURLPrefix, OUString& _inout_rDisplayName ); @@ -69,7 +69,7 @@ namespace dbaui virtual void dispose() SAL_OVERRIDE; /// set a handler which gets called every time the user selects a new type - void SetTypeSelectHandler( const Link& _rHandler ) { m_aTypeSelectHandler = _rHandler; } + void SetTypeSelectHandler( const Link<>& _rHandler ) { m_aTypeSelectHandler = _rHandler; } /// get the currently selected datasource type OUString GetSelectedType() const { return m_eCurrentSelection; } @@ -151,9 +151,9 @@ namespace dbaui DocumentDescriptor m_aBrowsedDocument; CreationMode m_eOriginalCreationMode; - Link m_aCreationModeHandler; /// to be called if a new type is selected - Link m_aDocumentSelectionHandler; /// to be called when a document in the RecentDoc list is selected - Link m_aChooseDocumentHandler; /// to be called when a recent document has been definitely chosen + Link<> m_aCreationModeHandler; /// to be called if a new type is selected + Link<> m_aDocumentSelectionHandler; /// to be called when a document in the RecentDoc list is selected + Link<> m_aChooseDocumentHandler; /// to be called when a recent document has been definitely chosen ::svt::ControlDependencyManager m_aControlDependencies; @@ -162,11 +162,11 @@ namespace dbaui void insertEmbeddedDBTypeEntryData( const OUString& _sType, const OUString& sDisplayName ); public: - void SetCreationModeHandler( const Link& _rHandler ) { m_aCreationModeHandler = _rHandler; } + void SetCreationModeHandler( const Link<>& _rHandler ) { m_aCreationModeHandler = _rHandler; } CreationMode GetDatabaseCreationMode() const; - void SetDocumentSelectionHandler( const Link& _rHandler) { m_aDocumentSelectionHandler = _rHandler; } - void SetChooseDocumentHandler( const Link& _rHandler) { m_aChooseDocumentHandler = _rHandler; } + void SetDocumentSelectionHandler( const Link<>& _rHandler) { m_aDocumentSelectionHandler = _rHandler; } + void SetChooseDocumentHandler( const Link<>& _rHandler) { m_aChooseDocumentHandler = _rHandler; } DocumentDescriptor GetSelectedDocument() const; protected: diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index a236e46ea7dc..67e2811d6848 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -40,8 +40,8 @@ namespace dbaui class DbaMouseDownListBoxController : public ListBoxCellController { protected: - Link m_aOriginalModifyHdl; - Link m_aAdditionalModifyHdl; + Link<> m_aOriginalModifyHdl; + Link<> m_aAdditionalModifyHdl; public: DbaMouseDownListBoxController(ListBoxControl* _pParent) @@ -49,24 +49,24 @@ namespace dbaui { } - void SetAdditionalModifyHdl(const Link& _rHdl); + void SetAdditionalModifyHdl(const Link<>& _rHdl); protected: virtual bool WantMouseEvent() const SAL_OVERRIDE { return true; } - virtual void SetModifyHdl(const Link& _rHdl) SAL_OVERRIDE; + virtual void SetModifyHdl(const Link<>& _rHdl) SAL_OVERRIDE; private: void implCheckLinks(); DECL_LINK( OnMultiplexModify, void* ); }; - void DbaMouseDownListBoxController::SetAdditionalModifyHdl(const Link& _rHdl) + void DbaMouseDownListBoxController::SetAdditionalModifyHdl(const Link<>& _rHdl) { m_aAdditionalModifyHdl = _rHdl; implCheckLinks(); } - void DbaMouseDownListBoxController::SetModifyHdl(const Link& _rHdl) + void DbaMouseDownListBoxController::SetModifyHdl(const Link<>& _rHdl) { m_aOriginalModifyHdl = _rHdl; implCheckLinks(); @@ -86,7 +86,7 @@ namespace dbaui if (m_aAdditionalModifyHdl.IsSet() || m_aOriginalModifyHdl.IsSet()) ListBoxCellController::SetModifyHdl(LINK(this, DbaMouseDownListBoxController, OnMultiplexModify)); else - ListBoxCellController::SetModifyHdl(Link()); + ListBoxCellController::SetModifyHdl(Link<>()); } // IndexFieldsControl diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index d563161e7214..ace45b3f3875 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -241,10 +241,10 @@ void OOdbcEnumeration::getDatasourceNames(StringBag& _rNames) class ProcessTerminationWait : public ::osl::Thread { oslProcess m_hProcessHandle; - Link m_aFinishHdl; + Link<> m_aFinishHdl; public: - ProcessTerminationWait( oslProcess _hProcessHandle, const Link& _rFinishHdl ) + ProcessTerminationWait( oslProcess _hProcessHandle, const Link<>& _rFinishHdl ) :m_hProcessHandle( _hProcessHandle ) ,m_aFinishHdl( _rFinishHdl ) { @@ -262,7 +262,7 @@ protected: }; // OOdbcManagement -OOdbcManagement::OOdbcManagement(const Link& rAsyncFinishCallback) +OOdbcManagement::OOdbcManagement(const Link<>& rAsyncFinishCallback) : m_aAsyncFinishCallback(rAsyncFinishCallback) { } diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index 36ee36dccad7..1631b714be6c 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.hxx +++ b/dbaccess/source/ui/dlg/odbcconfig.hxx @@ -105,10 +105,10 @@ class ProcessTerminationWait; class OOdbcManagement { ::std::unique_ptr< ProcessTerminationWait > m_pProcessWait; - Link m_aAsyncFinishCallback; + Link<> m_aAsyncFinishCallback; public: - OOdbcManagement( const Link& _rAsyncFinishCallback ); + OOdbcManagement( const Link<>& _rAsyncFinishCallback ); ~OOdbcManagement(); bool manageDataSources_async(); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index c0425048091a..30f898773fd7 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -213,9 +213,9 @@ namespace dbaui if (m_pCancelBtn == pButton) { // no interpreting of the given values anymore .... - m_pParam->SetLoseFocusHdl(Link()); // no direct call from the control anymore ... + m_pParam->SetLoseFocusHdl(Link<>()); // no direct call from the control anymore ... m_bNeedErrorOnCurrent = false; // in case of any indirect calls -> no error message - m_pCancelBtn->SetClickHdl(Link()); + m_pCancelBtn->SetClickHdl(Link<>()); m_pCancelBtn->Click(); } else if (m_pOKBtn == pButton) @@ -253,7 +253,7 @@ namespace dbaui } // to close the dialog (which is more code than a simple EndDialog) - m_pOKBtn->SetClickHdl(Link()); + m_pOKBtn->SetClickHdl(Link<>()); m_pOKBtn->Click(); } else if (m_pTravelNext == pButton) @@ -349,7 +349,7 @@ namespace dbaui Selection aSel; if (pOldFocus == m_pParam) { - m_pParam->SetLoseFocusHdl(Link()); + m_pParam->SetLoseFocusHdl(Link<>()); aSel = m_pParam->GetSelection(); } m_pTravelNext->GrabFocus(); diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 3b8d74618bd9..d4dcde17ed5c 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -41,7 +41,7 @@ namespace dbaui class OQueryTableView : public OJoinTableView { - Link m_lnkTabWinsChangeHandler; + Link<> m_lnkTabWinsChangeHandler; protected: virtual void ConnDoubleClicked(OTableConnection* pConnection) SAL_OVERRIDE; @@ -114,7 +114,7 @@ namespace dbaui void NotifyTabConnection(const OQueryTableConnection& rNewConn, bool _bCreateUndoAction = true); /// @note the Handler receives a pointer to a TabWinsChangeNotification struct - Link SetTabWinsChangeHandler(const Link& lnk) { Link lnkRet = m_lnkTabWinsChangeHandler; m_lnkTabWinsChangeHandler = lnk; return lnkRet; } + Link<> SetTabWinsChangeHandler(const Link<>& lnk) { Link<> lnkRet = m_lnkTabWinsChangeHandler; m_lnkTabWinsChangeHandler = lnk; return lnkRet; } bool ExistsAVisitedConn(const OQueryTableWindow* pFrom) const; diff --git a/dbaccess/source/ui/inc/ScrollHelper.hxx b/dbaccess/source/ui/inc/ScrollHelper.hxx index cf27cba19276..f709bb3092e7 100644 --- a/dbaccess/source/ui/inc/ScrollHelper.hxx +++ b/dbaccess/source/ui/inc/ScrollHelper.hxx @@ -27,8 +27,8 @@ namespace dbaui { class OScrollHelper { - Link m_aUpScroll; - Link m_aDownScroll; + Link<> m_aUpScroll; + Link<> m_aDownScroll; public: /** default constructor */ @@ -40,7 +40,7 @@ namespace dbaui @param _rUpScroll the method to set */ - inline void setUpScrollMethod( const Link& _rUpScroll ) + inline void setUpScrollMethod( const Link<>& _rUpScroll ) { m_aUpScroll = _rUpScroll; } @@ -49,7 +49,7 @@ namespace dbaui @param _rDownScroll the method to set */ - inline void setDownScrollMethod( const Link& _rDownScroll ) + inline void setDownScrollMethod( const Link<>& _rDownScroll ) { m_aDownScroll = _rDownScroll; } diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index cbeb1b6e540f..4dfd3c84a713 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -60,15 +60,15 @@ namespace dbaui IContextMenuProvider* m_pContextMenuProvider; - Link m_aPreExpandHandler; // handler to be called before a node is expanded - Link m_aSelChangeHdl; // handlet to be called (asynchronously) when the selection changes in any way - Link m_aCutHandler; // called when someone press CTRL+X - Link m_aCopyHandler; // called when someone press CTRL+C - Link m_aPasteHandler; // called when someone press CTRL+V - Link m_aDeleteHandler; // called when someone press DELETE Key - Link m_aEditingHandler; // called before someone will edit an entry - Link m_aEditedHandler; // called after someone edited an entry - Link m_aEnterKeyHdl; + Link<> m_aPreExpandHandler; // handler to be called before a node is expanded + Link<> m_aSelChangeHdl; // handlet to be called (asynchronously) when the selection changes in any way + Link<> m_aCutHandler; // called when someone press CTRL+X + Link<> m_aCopyHandler; // called when someone press CTRL+C + Link<> m_aPasteHandler; // called when someone press CTRL+V + Link<> m_aDeleteHandler; // called when someone press DELETE Key + Link<> m_aEditingHandler; // called before someone will edit an entry + Link<> m_aEditedHandler; // called after someone edited an entry + Link<> m_aEnterKeyHdl; bool m_bHandleEnterKey; @@ -89,14 +89,14 @@ namespace dbaui void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; } void setContextMenuProvider( IContextMenuProvider* _pContextMenuProvider ) { m_pContextMenuProvider = _pContextMenuProvider; } - void SetPreExpandHandler(const Link& _rHdl) { m_aPreExpandHandler = _rHdl; } - void SetSelChangeHdl( const Link& _rHdl ) { m_aSelChangeHdl = _rHdl; } - void setCutHandler(const Link& _rHdl) { m_aCutHandler = _rHdl; } - void setCopyHandler(const Link& _rHdl) { m_aCopyHandler = _rHdl; } - void setPasteHandler(const Link& _rHdl) { m_aPasteHandler = _rHdl; } - void setDeleteHandler(const Link& _rHdl) { m_aDeleteHandler = _rHdl; } - void setEditingHandler(const Link& _rHdl) { m_aEditingHandler = _rHdl; } - void setEditedHandler(const Link& _rHdl) { m_aEditedHandler = _rHdl; } + void SetPreExpandHandler(const Link<>& _rHdl) { m_aPreExpandHandler = _rHdl; } + void SetSelChangeHdl( const Link<>& _rHdl ) { m_aSelChangeHdl = _rHdl; } + void setCutHandler(const Link<>& _rHdl) { m_aCutHandler = _rHdl; } + void setCopyHandler(const Link<>& _rHdl) { m_aCopyHandler = _rHdl; } + void setPasteHandler(const Link<>& _rHdl) { m_aPasteHandler = _rHdl; } + void setDeleteHandler(const Link<>& _rHdl) { m_aDeleteHandler = _rHdl; } + void setEditingHandler(const Link<>& _rHdl) { m_aEditingHandler = _rHdl; } + void setEditedHandler(const Link<>& _rHdl) { m_aEditedHandler = _rHdl; } // modified the given entry so that the expand handler is called whenever the entry is expanded // (normally, the expand handler is called only once) @@ -121,7 +121,7 @@ namespace dbaui virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE; virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SAL_OVERRIDE; - void SetEnterKeyHdl(const Link& rNewHdl) {m_aEnterKeyHdl = rNewHdl;} + void SetEnterKeyHdl(const Link<>& rNewHdl) {m_aEnterKeyHdl = rNewHdl;} void clearCurrentSelection() { m_aSelectedEntries.clear(); } diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index bd595e012263..a1928d4acd99 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -43,18 +43,18 @@ namespace dbaui { protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; - Link m_aSelectHdl; - Link m_aEndEditHdl; + Link<> m_aSelectHdl; + Link<> m_aEndEditHdl; bool m_bSuspendSelectHdl; public: DbaIndexList(vcl::Window* _pParent, WinBits nWinBits); - void SetSelectHdl(const Link& _rHdl) { m_aSelectHdl = _rHdl; } - Link GetSelectHdl() const { return m_aSelectHdl; } + void SetSelectHdl(const Link<>& _rHdl) { m_aSelectHdl = _rHdl; } + Link<> GetSelectHdl() const { return m_aSelectHdl; } - void SetEndEditHdl(const Link& _rHdl) { m_aEndEditHdl = _rHdl; } - Link GetEndEditHdl() const { return m_aEndEditHdl; } + void SetEndEditHdl(const Link<>& _rHdl) { m_aEndEditHdl = _rHdl; } + Link<> GetEndEditHdl() const { return m_aEndEditHdl; } virtual bool Select(SvTreeListEntry* pEntry, bool bSelect) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index 787f897dc9bf..2a0519872e60 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -38,7 +38,7 @@ namespace dbaui IndexFields m_aFields; // !! order matters !! IndexFields::const_iterator m_aSeekRow; // !! - Link m_aModifyHdl; + Link<> m_aModifyHdl; VclPtr< ::svt::ListBoxControl> m_pSortingCell; VclPtr< ::svt::ListBoxControl> m_pFieldNameCell; @@ -65,8 +65,8 @@ namespace dbaui const IndexFields& GetSavedValue() const { return m_aSavedValue; } void SaveValue() { m_aSavedValue = m_aFields; } - void SetModifyHdl(const Link& _rHdl) { m_aModifyHdl = _rHdl; } - Link GetModifyHdl() const { return m_aModifyHdl; } + void SetModifyHdl(const Link<>& _rHdl) { m_aModifyHdl = _rHdl; } + Link<> GetModifyHdl() const { return m_aModifyHdl; } virtual OUString GetCellText(long _nRow,sal_uInt16 nColId) const SAL_OVERRIDE; protected: diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx index 06d9c8aeba62..889716f641ed 100644 --- a/dbaccess/source/ui/inc/marktree.hxx +++ b/dbaccess/source/ui/inc/marktree.hxx @@ -35,7 +35,7 @@ namespace dbaui class OMarkableTreeListBox : public DBTreeListBox { SvLBoxButtonData* m_pCheckButton; - Link m_aCheckButtonHandler; + Link<> m_aCheckButtonHandler; public: OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinStyle=0 ); @@ -47,7 +47,7 @@ public: void CheckButtons(); // make the button states consistent (bottom-up) /// the handler given is called whenever the check state of one or more items changed - void SetCheckHandler(const Link& _rHdl) { m_aCheckButtonHandler = _rHdl; } + void SetCheckHandler(const Link<>& _rHdl) { m_aCheckButtonHandler = _rHdl; } protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect) SAL_OVERRIDE; diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 2e5ac221ee65..81695cc21f72 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -41,7 +41,7 @@ namespace dbaui Timer m_timerInvalidate; Timer m_timerUndoActionCreation; - Link m_lnkTextModifyHdl; + Link<> m_lnkTextModifyHdl; OUString m_strOrigText; // is restored on undo VclPtr<OQueryTextView> m_pView; bool m_bAccelAction; // is set on cut, copy, paste @@ -80,7 +80,7 @@ namespace dbaui // To prevent this, SlotExec in View can call this function. bool IsInAccelAct() { return m_bAccelAction; } - void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; } + void SetTextModifyHdl(const Link<>& lnk) { m_lnkTextModifyHdl = lnk; } // please don't use SetModifyHdl, I need it for myself, this here is called from the handler set with that // the link gets a pointer-to-string, which is invalid after the link |