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 /include/svx | |
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 'include/svx')
-rw-r--r-- | include/svx/charmap.hxx | 24 | ||||
-rw-r--r-- | include/svx/ctredlin.hxx | 78 | ||||
-rw-r--r-- | include/svx/dialcontrol.hxx | 6 | ||||
-rw-r--r-- | include/svx/dlgctl3d.hxx | 24 | ||||
-rw-r--r-- | include/svx/fmshell.hxx | 2 | ||||
-rw-r--r-- | include/svx/fmsrcimp.hxx | 12 | ||||
-rw-r--r-- | include/svx/frmsel.hxx | 4 | ||||
-rw-r--r-- | include/svx/galctrl.hxx | 4 | ||||
-rw-r--r-- | include/svx/galtheme.hxx | 2 | ||||
-rw-r--r-- | include/svx/graphctl.hxx | 24 | ||||
-rw-r--r-- | include/svx/gridctrl.hxx | 8 | ||||
-rw-r--r-- | include/svx/passwd.hxx | 4 | ||||
-rw-r--r-- | include/svx/rubydialog.hxx | 8 | ||||
-rw-r--r-- | include/svx/sdrundomanager.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdedxv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdetc.hxx | 23 | ||||
-rw-r--r-- | include/svx/svdhdl.hxx | 6 | ||||
-rw-r--r-- | include/svx/svdmodel.hxx | 12 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 10 | ||||
-rw-r--r-- | include/svx/svxdlg.hxx | 18 |
20 files changed, 136 insertions, 139 deletions
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index db9e95361a75..6423076a09eb 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -53,14 +53,14 @@ public: void SelectCharacter( sal_uInt32 cNew, bool bFocus = false ); sal_UCS4 GetSelectCharacter() const; - Link GetDoubleClickHdl() const { return aDoubleClkHdl; } - void SetDoubleClickHdl( const Link& rLink ) { aDoubleClkHdl = rLink; } - Link GetSelectHdl() const { return aSelectHdl; } - void SetSelectHdl( const Link& rHdl ) { aSelectHdl = rHdl; } - Link GetHighlightHdl() const { return aHighHdl; } - void SetHighlightHdl( const Link& rHdl ) { aHighHdl = rHdl; } - Link GetPreSelectHdl() const { return aHighHdl; } - void SetPreSelectHdl( const Link& rHdl ) { aPreSelectHdl = rHdl; } + Link<> GetDoubleClickHdl() const { return aDoubleClkHdl; } + void SetDoubleClickHdl( const Link<>& rLink ) { aDoubleClkHdl = rLink; } + Link<> GetSelectHdl() const { return aSelectHdl; } + void SetSelectHdl( const Link<>& rHdl ) { aSelectHdl = rHdl; } + Link<> GetHighlightHdl() const { return aHighHdl; } + void SetHighlightHdl( const Link<>& rHdl ) { aHighHdl = rHdl; } + Link<> GetPreSelectHdl() const { return aHighHdl; } + void SetPreSelectHdl( const Link<>& rHdl ) { aPreSelectHdl = rHdl; } static sal_uInt32& getSelectedChar(); svx::SvxShowCharSetItem* ImplGetItem( int _nPos ); @@ -100,10 +100,10 @@ protected: private: typedef std::map<sal_Int32, std::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap; ItemsMap m_aItems; - Link aDoubleClkHdl; - Link aSelectHdl; - Link aHighHdl; - Link aPreSelectHdl; + Link<> aDoubleClkHdl; + Link<> aSelectHdl; + Link<> aHighHdl; + Link<> aPreSelectHdl; svx::SvxShowCharSetVirtualAcc* m_pAccessible; ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAccessible; long nX; diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index 7b1e6ac9b6e5..07e05789a893 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -103,7 +103,7 @@ private: Image maEntryImage; OUString maEntryString; utl::TextSearch* pCommentSearcher; - Link aColCompareLink; + Link<> aColCompareLink; protected: @@ -161,8 +161,8 @@ public: virtual SvTreeListEntry* CreateEntry() const SAL_OVERRIDE; - void SetColCompareHdl(const Link& rLink ) { aColCompareLink = rLink; } - const Link& GetColCompareHdl() const { return aColCompareLink; } + void SetColCompareHdl(const Link<>& rLink ) { aColCompareLink = rLink; } + const Link<>& GetColCompareHdl() const { return aColCompareLink; } }; /// Tabpage with the filter text entries etc. @@ -170,13 +170,13 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxTPFilter: public TabPage { private: - Link aReadyLink; - Link aModifyLink; - Link aModifyDateLink; - Link aModifyAuthorLink; - Link aModifyRefLink; - Link aRefLink; - Link aModifyComLink; + Link<> aReadyLink; + Link<> aModifyLink; + Link<> aModifyDateLink; + Link<> aModifyAuthorLink; + Link<> aModifyRefLink; + Link<> aRefLink; + Link<> aModifyComLink; VclPtr<SvxRedlinTable> pRedlinTable; VclPtr<CheckBox> m_pCbDate; @@ -266,28 +266,28 @@ public: ListBox* GetLbAction() { return m_pLbAction;} - void SetReadyHdl( const Link& rLink ) { aReadyLink= rLink; } - const Link& GetReadyHdl() const { return aReadyLink; } + void SetReadyHdl( const Link<>& rLink ) { aReadyLink= rLink; } + const Link<>& GetReadyHdl() const { return aReadyLink; } - void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; } - const Link& GetModifyHdl() const { return aModifyLink; } + void SetModifyHdl( const Link<>& rLink ) { aModifyLink = rLink; } + const Link<>& GetModifyHdl() const { return aModifyLink; } - void SetModifyDateHdl( const Link& rLink ) { aModifyDateLink = rLink; } - const Link& GetModifyDateHdl() const { return aModifyDateLink; } + void SetModifyDateHdl( const Link<>& rLink ) { aModifyDateLink = rLink; } + const Link<>& GetModifyDateHdl() const { return aModifyDateLink; } - void SetModifyAuthorHdl( const Link& rLink ) { aModifyAuthorLink = rLink; } - const Link& GetModifyAuthorHdl() const { return aModifyAuthorLink; } + void SetModifyAuthorHdl( const Link<>& rLink ) { aModifyAuthorLink = rLink; } + const Link<>& GetModifyAuthorHdl() const { return aModifyAuthorLink; } - void SetModifyCommentHdl(const Link& rLink ) { aModifyComLink = rLink; } - const Link& GetModifyCommentHdl() const { return aModifyComLink; } + void SetModifyCommentHdl(const Link<>& rLink ) { aModifyComLink = rLink; } + const Link<>& GetModifyCommentHdl() const { return aModifyComLink; } // Methods for Calc { - void SetModifyRangeHdl( const Link& rLink ) { aModifyRefLink = rLink; } - const Link& GetModifyRangeHdl() const { return aModifyRefLink; } + void SetModifyRangeHdl( const Link<>& rLink ) { aModifyRefLink = rLink; } + const Link<>& GetModifyRangeHdl() const { return aModifyRefLink; } - void SetRefHdl( const Link& rLink ) { aRefLink = rLink; } - const Link& GetRefHdl() const { return aRefLink; } + void SetRefHdl( const Link<>& rLink ) { aRefLink = rLink; } + const Link<>& GetRefHdl() const { return aRefLink; } void Enable( bool bEnable = true, bool bChild = true ); void Disable( bool bChild = true ); @@ -299,11 +299,11 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxTPView : public TabPage { private: - Link AcceptClickLk; - Link AcceptAllClickLk; - Link RejectClickLk; - Link RejectAllClickLk; - Link UndoClickLk; + Link<> AcceptClickLk; + Link<> AcceptAllClickLk; + Link<> RejectClickLk; + Link<> RejectAllClickLk; + Link<> UndoClickLk; VclPtr<SvxRedlinTable> m_pViewData; VclPtr<PushButton> m_pAccept; @@ -345,20 +345,20 @@ public: void HideUndo() {ShowUndo(false);} bool IsUndoVisible(); - void SetAcceptClickHdl( const Link& rLink ) { AcceptClickLk = rLink; } - const Link& GetAcceptClickHdl() const { return AcceptClickLk; } + void SetAcceptClickHdl( const Link<>& rLink ) { AcceptClickLk = rLink; } + const Link<>& GetAcceptClickHdl() const { return AcceptClickLk; } - void SetAcceptAllClickHdl( const Link& rLink ) { AcceptAllClickLk = rLink; } - const Link& GetAcceptAllClickHdl() const { return AcceptAllClickLk; } + void SetAcceptAllClickHdl( const Link<>& rLink ) { AcceptAllClickLk = rLink; } + const Link<>& GetAcceptAllClickHdl() const { return AcceptAllClickLk; } - void SetRejectClickHdl( const Link& rLink ) { RejectClickLk = rLink; } - const Link& GetRejectClickHdl() const { return RejectClickLk; } + void SetRejectClickHdl( const Link<>& rLink ) { RejectClickLk = rLink; } + const Link<>& GetRejectClickHdl() const { return RejectClickLk; } - void SetRejectAllClickHdl( const Link& rLink ) { RejectAllClickLk = rLink; } - const Link& GetRejectAllClickHdl() const { return RejectAllClickLk; } + void SetRejectAllClickHdl( const Link<>& rLink ) { RejectAllClickLk = rLink; } + const Link<>& GetRejectAllClickHdl() const { return RejectAllClickLk; } - void SetUndoClickHdl( const Link& rLink ) { UndoClickLk = rLink; } - const Link& GetUndoAllClickHdl() const { return UndoClickLk; } + void SetUndoClickHdl( const Link<>& rLink ) { UndoClickLk = rLink; } + const Link<>& GetUndoAllClickHdl() const { return UndoClickLk; } virtual void ActivatePage() SAL_OVERRIDE; virtual void DeactivatePage() SAL_OVERRIDE; diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx index 13a182da1503..ef05aa0f4503 100644 --- a/include/svx/dialcontrol.hxx +++ b/include/svx/dialcontrol.hxx @@ -113,7 +113,7 @@ public: void SetLinkedField( NumericField* pField, sal_Int32 nDecimalPlaces = 0); /** The passed handler is called whenever the totation value changes. */ - void SetModifyHdl( const Link& rLink ); + void SetModifyHdl( const Link<>& rLink ); /** Save value for later comparison */ void SaveValue(); @@ -127,7 +127,7 @@ protected: ScopedVclPtr<DialControlBmp> mxBmpEnabled; ScopedVclPtr<DialControlBmp> mxBmpDisabled; ScopedVclPtr<DialControlBmp> mxBmpBuffered; - Link maModifyHdl; + Link<> maModifyHdl; VclPtr<NumericField> mpLinkField; sal_Int32 mnLinkedFieldValueMultiplyer; Size maWinSize; @@ -156,7 +156,7 @@ protected: private: void InvalidateControl(); - void ImplSetFieldLink( const Link& rLink ); + void ImplSetFieldLink( const Link<>& rLink ); DECL_LINK( LinkedFieldModifyHdl, NumericField* ); diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx index 4d704d63814a..ca77be777db1 100644 --- a/include/svx/dlgctl3d.hxx +++ b/include/svx/dlgctl3d.hxx @@ -67,10 +67,10 @@ public: class SVX_DLLPUBLIC SAL_WARN_UNUSED Svx3DLightControl : public Svx3DPreviewControl { // Callback for interactive changes - Link maUserInteractiveChangeCallback; - Link maUserSelectionChangeCallback; - Link maChangeCallback; - Link maSelectionChangeCallback; + Link<> maUserInteractiveChangeCallback; + Link<> maUserSelectionChangeCallback; + Link<> maChangeCallback; + Link<> maSelectionChangeCallback; // lights sal_uInt32 maSelectedLight; @@ -113,10 +113,10 @@ public: virtual void SetObjectType(SvxPreviewObjectType nType) SAL_OVERRIDE; // register user callback - void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; } - void SetUserSelectionChangeCallback(Link aNew) { maUserSelectionChangeCallback = aNew; } - void SetChangeCallback(Link aNew) { maChangeCallback = aNew; } - void SetSelectionChangeCallback(Link aNew) { maSelectionChangeCallback = aNew; } + void SetUserInteractiveChangeCallback(Link<> aNew) { maUserInteractiveChangeCallback = aNew; } + void SetUserSelectionChangeCallback(Link<> aNew) { maUserSelectionChangeCallback = aNew; } + void SetChangeCallback(Link<> aNew) { maChangeCallback = aNew; } + void SetSelectionChangeCallback(Link<> aNew) { maSelectionChangeCallback = aNew; } // selection checks bool IsSelectionValid(); @@ -150,8 +150,8 @@ private: VclPtr<PushButton> maSwitcher; // callback for interactive changes - Link maUserInteractiveChangeCallback; - Link maUserSelectionChangeCallback; + Link<> maUserInteractiveChangeCallback; + Link<> maUserSelectionChangeCallback; public: SvxLightCtl3D(vcl::Window* pParent); @@ -169,8 +169,8 @@ public: Svx3DLightControl& GetSvx3DLightControl() { return *maLightControl.get(); } // register user callback - void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; } - void SetUserSelectionChangeCallback(Link aNew) { maUserSelectionChangeCallback = aNew; } + void SetUserInteractiveChangeCallback(Link<> aNew) { maUserInteractiveChangeCallback = aNew; } + void SetUserSelectionChangeCallback(Link<> aNew) { maUserSelectionChangeCallback = aNew; } virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx index 01f91198d3cb..f68543095cff 100644 --- a/include/svx/fmshell.hxx +++ b/include/svx/fmshell.hxx @@ -130,7 +130,7 @@ public: bool IsActiveControl() const; void ForgetActiveControl(); - void SetControlActivationHandler( const Link& _rHdl ); + void SetControlActivationHandler( const Link<>& _rHdl ); virtual void Activate(bool bMDI) SAL_OVERRIDE; virtual void Deactivate(bool bMDI) SAL_OVERRIDE; diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx index c94731e7d695..5bb785c4ea38 100644 --- a/include/svx/fmsrcimp.hxx +++ b/include/svx/fmsrcimp.hxx @@ -45,14 +45,14 @@ class FmSearchEngine; class SAL_WARN_UNUSED FmSearchThread : public ::osl::Thread { FmSearchEngine* m_pEngine; - Link m_aTerminationHdl; + Link<> m_aTerminationHdl; virtual void SAL_CALL run() SAL_OVERRIDE; virtual void SAL_CALL onTerminated() SAL_OVERRIDE; public: FmSearchThread(FmSearchEngine* pEngine) : m_pEngine(pEngine) { } - void setTerminationHandler(Link aHdl) { m_aTerminationHdl = aHdl; } + void setTerminationHandler(Link<> aHdl) { m_aTerminationHdl = aHdl; } }; /** @@ -84,12 +84,12 @@ struct FmSearchProgress class SAL_WARN_UNUSED FmRecordCountListener : public ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener> { // attribute - Link m_lnkWhoWantsToKnow; + Link<> m_lnkWhoWantsToKnow; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xListening; // attribute access public: - Link SetPropChangeHandler(const Link& lnk); + Link<> SetPropChangeHandler(const Link<>& lnk); // methods public: @@ -211,7 +211,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FmSearchEngine SEARCH_RESULT m_srResult; // backward direction // The link we broadcast the progress and the result to - Link m_aProgressHandler; + Link<> m_aProgressHandler; bool m_bSearchingCurrently : 1; // is an (asynchronous) search running? bool m_bCancelAsynchRequest : 1; // should be cancelled? ::osl::Mutex m_aCancelAsynchAccess; // access to_bCancelAsynchRequest (technically only @@ -312,7 +312,7 @@ public: a FmSearchProgress structure the handler should be in any case thread-safe */ - void SetProgressHandler(Link aHdl) { m_aProgressHandler = aHdl; } + void SetProgressHandler(Link<> aHdl) { m_aProgressHandler = aHdl; } /// search for the next appearance (for nDirection values check DIRECTION_*-defines) void SearchNext(const OUString& strExpression); diff --git a/include/svx/frmsel.hxx b/include/svx/frmsel.hxx index bd262b3e5b5b..66f36f57e628 100644 --- a/include/svx/frmsel.hxx +++ b/include/svx/frmsel.hxx @@ -132,9 +132,9 @@ public: // frame border selection ------------------------------------------------- /** Returns the current selection handler. */ - const Link& GetSelectHdl() const; + const Link<>& GetSelectHdl() const; /** Sets the passed handler that is called if the selection of the control changes. */ - void SetSelectHdl( const Link& rHdl ); + void SetSelectHdl( const Link<>& rHdl ); /** Returns true, if the specified frame border is selected. */ bool IsBorderSelected( FrameBorderType eBorder ) const; diff --git a/include/svx/galctrl.hxx b/include/svx/galctrl.hxx index 71ca12449521..fa9f5dab4d52 100644 --- a/include/svx/galctrl.hxx +++ b/include/svx/galctrl.hxx @@ -118,7 +118,7 @@ class GalleryListView : public BrowseBox private: - Link maSelectHdl; + Link<> maSelectHdl; GalleryTheme* mpTheme; long mnCurRow; @@ -144,7 +144,7 @@ public: GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme ); - void SetSelectHdl( const Link& rSelectHdl ) { maSelectHdl = rSelectHdl; } + void SetSelectHdl( const Link<>& rSelectHdl ) { maSelectHdl = rSelectHdl; } /** GetCellText returns the text at the given position @param _nRow diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx index bc06735e2802..2597870a5153 100644 --- a/include/svx/galtheme.hxx +++ b/include/svx/galtheme.hxx @@ -178,7 +178,7 @@ public: bool IsDefault() const; SAL_DLLPRIVATE bool IsModified() const; - void Actualize( const Link& rActualizeLink, GalleryProgress* pProgress = NULL ); + void Actualize( const Link<>& rActualizeLink, GalleryProgress* pProgress = NULL ); SAL_DLLPRIVATE void AbortActualize() { bAbortActualize = true; } SAL_DLLPRIVATE Gallery* GetParent() const { return pParent; } diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx index aff192e19e71..77fb49484a0e 100644 --- a/include/svx/graphctl.hxx +++ b/include/svx/graphctl.hxx @@ -39,10 +39,10 @@ class SVX_DLLPUBLIC GraphCtrl : public Control Graphic aGraphic; Idle aUpdateIdle; - Link aMousePosLink; - Link aGraphSizeLink; - Link aMarkObjLink; - Link aUpdateLink; + Link<> aMousePosLink; + Link<> aGraphSizeLink; + Link<> aMarkObjLink; + Link<> aUpdateLink; MapMode aMap100; Size aGraphSize; Point aMousePos; @@ -107,17 +107,17 @@ public: SdrObject* GetSelectedSdrObject() const; bool IsChanged() const { return bSdrMode && pModel->IsChanged(); } - void SetMousePosLink( const Link& rLink ) { aMousePosLink = rLink; } - const Link& GetMousePosLink() const { return aMousePosLink; } + void SetMousePosLink( const Link<>& rLink ) { aMousePosLink = rLink; } + const Link<>& GetMousePosLink() const { return aMousePosLink; } - void SetGraphSizeLink( const Link& rLink ) { aGraphSizeLink = rLink; } - const Link& GetGraphSizeLink() const { return aGraphSizeLink; } + void SetGraphSizeLink( const Link<>& rLink ) { aGraphSizeLink = rLink; } + const Link<>& GetGraphSizeLink() const { return aGraphSizeLink; } - void SetMarkObjLink( const Link& rLink ) { aMarkObjLink = rLink; } - const Link& GetMarkObjLink() const { return aMarkObjLink; } + void SetMarkObjLink( const Link<>& rLink ) { aMarkObjLink = rLink; } + const Link<>& GetMarkObjLink() const { return aMarkObjLink; } - void SetUpdateLink( const Link& rLink ) { aUpdateLink = rLink; } - const Link& GetUpdateLink() const { return aUpdateLink; } + void SetUpdateLink( const Link<>& rLink ) { aUpdateLink = rLink; } + const Link<>& GetUpdateLink() const { return aUpdateLink; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE; }; diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx index ec8ece737dfb..677e4c9e5595 100644 --- a/include/svx/gridctrl.hxx +++ b/include/svx/gridctrl.hxx @@ -220,8 +220,8 @@ public: private: vcl::Font m_aDefaultFont; - Link m_aMasterStateProvider; - Link m_aMasterSlotExecutor; + Link<> m_aMasterStateProvider; + Link<> m_aMasterSlotExecutor; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; @@ -478,13 +478,13 @@ public: const DbGridRowRef& GetCurrentRow() const {return m_xCurrentRow;} - void SetStateProvider(const Link& rProvider) { m_aMasterStateProvider = rProvider; } + void SetStateProvider(const Link<>& rProvider) { m_aMasterStateProvider = rProvider; } // if this link is set the given provider will be asked for the state of my items. // the return values are interpreted as follows : // <0 -> not specified (use default mechanism to determine the state) // ==0 -> the item is disabled // >0 -> the item is enabled - void SetSlotExecutor(const Link& rExecutor) { m_aMasterSlotExecutor = rExecutor; } + void SetSlotExecutor(const Link<>& rExecutor) { m_aMasterSlotExecutor = rExecutor; } // analogous : if this link is set, all nav-bar slots will be routed through it when executed // if the handler returns nonzero, no further handling of the slot occurs diff --git a/include/svx/passwd.hxx b/include/svx/passwd.hxx index 89fbbded5221..daeb5928d091 100644 --- a/include/svx/passwd.hxx +++ b/include/svx/passwd.hxx @@ -43,7 +43,7 @@ private: OUString aOldPasswdErrStr; OUString aRepeatPasswdErrStr; - Link aCheckPasswordHdl; + Link<> aCheckPasswordHdl; bool bEmpty; @@ -58,7 +58,7 @@ public: OUString GetOldPassword() const { return m_pOldPasswdED->GetText(); } OUString GetNewPassword() const { return m_pNewPasswdED->GetText(); } - void SetCheckPasswordHdl( const Link& rLink ) { aCheckPasswordHdl = rLink; } + void SetCheckPasswordHdl( const Link<>& rLink ) { aCheckPasswordHdl = rLink; } }; diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx index f77bee62b94f..7729ab54449f 100644 --- a/include/svx/rubydialog.hxx +++ b/include/svx/rubydialog.hxx @@ -69,8 +69,8 @@ class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow class SvxRubyData_Impl; class RubyEdit : public Edit { - Link aScrollHdl; - Link aJumpHdl; + Link<> aScrollHdl; + Link<> aJumpHdl; virtual void GetFocus() SAL_OVERRIDE; virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; public: @@ -82,8 +82,8 @@ public: : Edit(pParent, WB_BORDER) { } - void SetScrollHdl(Link& rLink) {aScrollHdl = rLink;} - void SetJumpHdl(Link& rLink) {aJumpHdl = rLink;} + void SetScrollHdl(Link<>& rLink) {aScrollHdl = rLink;} + void SetJumpHdl(Link<>& rLink) {aJumpHdl = rLink;} }; diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx index 1469642d6e30..96dc794997f8 100644 --- a/include/svx/sdrundomanager.hxx +++ b/include/svx/sdrundomanager.hxx @@ -30,7 +30,7 @@ private: using EditUndoManager::Undo; using EditUndoManager::Redo; - Link maEndTextEditHdl; + Link<> maEndTextEditHdl; SfxUndoAction* mpLastUndoActionBeforeTextEdit; bool mbEndTextEditTriggeredFromUndo; @@ -53,7 +53,7 @@ public: // activate (start text edit) and empty link to reset (end text edit). On // reset all text edit actions will be removed from this undo manager to // restore the state before activation - void SetEndTextEditHdl(const Link& rLink); + void SetEndTextEditHdl(const Link<>& rLink); // check from outside if we are inside a callback for ending text edit. This // is needed to detect inside end text edit if it is a regular one or triggered diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index ed0ce097989c..e422125e7242 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -74,7 +74,7 @@ protected: Rectangle aTextEditArea; Rectangle aMinTextEditArea; - Link aOldCalcFieldValueLink; // for call the old handler + Link<> aOldCalcFieldValueLink; // for call the old handler Point aMacroDownPos; sal_uInt16 nMacroTol; diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 1e47e180a53d..16453d8ad16a 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -23,6 +23,7 @@ #include <rtl/ustring.hxx> #include <editeng/outliner.hxx> #include <svx/svxdllapi.h> +#include <tools/link.hxx> #include <tools/shl.hxx> #include <tools/fract.hxx> #include <vcl/outdev.hxx> @@ -119,10 +120,6 @@ bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnl // man dann irgendwann mit delete platthauen muss. sal_uInt16* RemoveWhichRange(const sal_uInt16* pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd); - - -class Link; - // Hilfsklasse zur kommunikation zwischen dem Dialog // zum aufbrechen von Metafiles (sd/source/ui/dlg/brkdlg.cxx), // SdrEditView::DoImportMarkedMtf() und @@ -142,10 +139,10 @@ private: sal_uIntPtr nObjCount; // Anzahl der selektierten Objekte sal_uIntPtr nCurObj; // Aktuelles Objekt - Link *pLink; + Link<> *pLink; public: - SvdProgressInfo( Link *_pLink ); + SvdProgressInfo( Link<> *_pLink ); void Init( sal_uIntPtr _nSumActionCount, sal_uIntPtr _nObjCount ); @@ -175,19 +172,19 @@ public: class SdrLinkList { - std::vector<Link*> aList; + std::vector<Link<>*> aList; protected: - unsigned FindEntry(const Link& rLink) const; + unsigned FindEntry(const Link<>& rLink) const; public: SdrLinkList(): aList() {} ~SdrLinkList() { Clear(); } SVX_DLLPUBLIC void Clear(); unsigned GetLinkCount() const { return (unsigned)aList.size(); } - Link& GetLink(unsigned nNum) { return *aList[nNum]; } - const Link& GetLink(unsigned nNum) const { return *aList[nNum]; } - void InsertLink(const Link& rLink, unsigned nPos=0xFFFF); - void RemoveLink(const Link& rLink); - bool HasLink(const Link& rLink) const { return FindEntry(rLink)!=0xFFFF; } + Link<>& GetLink(unsigned nNum) { return *aList[nNum]; } + const Link<>& GetLink(unsigned nNum) const { return *aList[nNum]; } + void InsertLink(const Link<>& rLink, unsigned nPos=0xFFFF); + void RemoveLink(const Link<>& rLink); + bool HasLink(const Link<>& rLink) const { return FindEntry(rLink)!=0xFFFF; } }; SdrLinkList& ImpGetUserMakeObjHdl(); diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx index 22a55ed40e02..ce74428e219b 100644 --- a/include/svx/svdhdl.hxx +++ b/include/svx/svdhdl.hxx @@ -258,7 +258,7 @@ private: Color aMarkerColor; // callback link when value changed - Link aColorChangeHdl; + Link<> aColorChangeHdl; // use luminance values only bool bUseLuminance : 1; @@ -283,8 +283,8 @@ public: const Size& GetSize() const { return aMarkerSize; } void SetSize(const Size& rNew); - void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; } - const Link& GetColorChangeHdl() const { return aColorChangeHdl; } + void SetColorChangeHdl(const Link<>& rLink) { aColorChangeHdl = rLink; } + const Link<>& GetColorChangeHdl() const { return aColorChangeHdl; } }; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 5cd184e4640d..2248d4bebb7a 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -157,8 +157,8 @@ protected: DateTime aReadDate; // date of the incoming stream std::vector<SdrPage*> maMaPag; // master pages std::vector<SdrPage*> maPages; - Link aUndoLink; // link to a NotifyUndo-Handler - Link aIOProgressLink; + Link<> aUndoLink; // link to a NotifyUndo-Handler + Link<> aIOProgressLink; OUString aTablePath; Size aMaxObjSize; // e.g. for auto-growing text Fraction aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ... @@ -578,8 +578,8 @@ public: // void NotifyUndoActionHdl(SfxUndoAction* pUndoAction); // When calling the handler ownership is transferred; // The UndoAction belongs to the Handler, not the SdrModel. - void SetNotifyUndoActionHdl(const Link& rLink) { aUndoLink=rLink; } - const Link& GetNotifyUndoActionHdl() const { return aUndoLink; } + void SetNotifyUndoActionHdl(const Link<>& rLink) { aUndoLink=rLink; } + const Link<>& GetNotifyUndoActionHdl() const { return aUndoLink; } /** application can set its own undo manager, BegUndo, EndUndo and AddUndoAction calls are routet to this interface if given */ @@ -605,8 +605,8 @@ public: // Mind that the handler will also be called if the App serves Draw data in the // office wide Draw-Exchange-Format because that happens through streaming into // a MemoryStream. - void SetIOProgressHdl(const Link& rLink) { aIOProgressLink=rLink; } - const Link& GetIOProgressHdl() const { return aIOProgressLink; } + void SetIOProgressHdl(const Link<>& rLink) { aIOProgressLink=rLink; } + const Link<>& GetIOProgressHdl() const { return aIOProgressLink; } // Accessor methods for Palettes, Lists and Tabeles // FIXME: this badly needs re-factoring ... diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index e3d77ccae081..de32cf06ce7e 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -31,6 +31,7 @@ #include <svx/xenum.hxx> #include <svx/svxdllapi.h> #include <svx/shapeproperty.hxx> +#include <tools/link.hxx> #include <tools/weakbase.hxx> #include <tools/mapunit.hxx> #include <tools/gen.hxx> @@ -69,7 +70,6 @@ class SdrGluePointList; class SetOfByte; class OutputDevice; class Fraction; -class Link; namespace basegfx { @@ -1016,10 +1016,10 @@ private: public: static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL); static SdrObject* MakeNewObject( sal_uInt32 nInventor, sal_uInt16 nIdentifier, const Rectangle& rSnapRect, SdrPage* pPage ); - static void InsertMakeObjectHdl(const Link& rLink); - static void RemoveMakeObjectHdl(const Link& rLink); - static void InsertMakeUserDataHdl(const Link& rLink); - static void RemoveMakeUserDataHdl(const Link& rLink); + static void InsertMakeObjectHdl(const Link<>& rLink); + static void RemoveMakeObjectHdl(const Link<>& rLink); + static void InsertMakeUserDataHdl(const Link<>& rLink); + static void RemoveMakeUserDataHdl(const Link<>& rLink); }; typedef tools::WeakReference< SdrObject > SdrObjectWeakRef; diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 1854f0248988..ebf3226e2129 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -178,7 +178,7 @@ class AbstractSvxNameDialog :public VclAbstractDialog { public: virtual void GetName( OUString& rName ) = 0; - virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) = 0; + virtual void SetCheckNameHdl( const Link<>& rLink, bool bCheckImmediately = false ) = 0; virtual void SetEditHelpId(const OString&) = 0; //from class Window virtual void SetHelpId( const OString& ) = 0; @@ -189,7 +189,7 @@ class AbstractSvxObjectNameDialog :public VclAbstractDialog { public: virtual void GetName(OUString& rName) = 0; - virtual void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false) = 0; + virtual void SetCheckNameHdl(const Link<>& rLink, bool bCheckImmediately = false) = 0; }; class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog @@ -223,8 +223,8 @@ public: class AbstractFmSearchDialog :public VclAbstractDialog { public: - virtual void SetFoundHandler(const Link& lnk) = 0; - virtual void SetCanceledNotFoundHdl(const Link& lnk)=0; + virtual void SetFoundHandler(const Link<>& lnk) = 0; + virtual void SetCanceledNotFoundHdl(const Link<>& lnk)=0; virtual void SetActiveField(const OUString& strField)=0; }; @@ -241,13 +241,13 @@ class AbstractSvxAreaTabDialog :public SfxAbstractTabDialog class AbstractSvxTransformTabDialog : public SfxAbstractTabDialog { public: - virtual void SetValidateFramePosLink( const Link& rLink ) = 0; + virtual void SetValidateFramePosLink( const Link<>& rLink ) = 0; }; class AbstractSvxCaptionDialog : public SfxAbstractTabDialog { public: - virtual void SetValidateFramePosLink( const Link& rLink ) = 0; + virtual void SetValidateFramePosLink( const Link<>& rLink ) = 0; }; class AbstractSvxPostItDialog :public VclAbstractDialog @@ -255,8 +255,8 @@ class AbstractSvxPostItDialog :public VclAbstractDialog public: virtual void SetText( const OUString& rStr ) = 0; //From class Window virtual const SfxItemSet* GetOutputItemSet() const = 0; - virtual void SetPrevHdl( const Link& rLink ) = 0; - virtual void SetNextHdl( const Link& rLink ) = 0; + virtual void SetPrevHdl( const Link<>& rLink ) = 0; + virtual void SetNextHdl( const Link<>& rLink ) = 0; virtual void EnableTravel(bool bNext, bool bPrev) = 0; virtual OUString GetNote() = 0; virtual void SetNote(const OUString& rTxt) = 0; @@ -396,7 +396,7 @@ public: const OUString& strInitialText, const ::std::vector< OUString >& _rContexts, sal_Int16 nInitialContext, - const Link& lnkContextSupplier)=0; + const Link<>& lnkContextSupplier)=0; virtual AbstractGraphicFilterDialog * CreateGraphicFilterEmboss(vcl::Window* pParent, const Graphic& rGraphic, RECT_POINT eLightSource)=0; |