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/sfx2 | |
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/sfx2')
-rw-r--r-- | include/sfx2/app.hxx | 6 | ||||
-rw-r--r-- | include/sfx2/basedlgs.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/dinfdlg.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/docfile.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/docinsert.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/filedlghelper.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/genlink.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/linksrc.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/lnkbase.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sfxdlg.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/tabdlg.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/tbxctrl.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/templateabstractview.hxx | 8 | ||||
-rw-r--r-- | include/sfx2/thumbnailview.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/thumbnailviewitem.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/titledockwin.hxx | 10 |
16 files changed, 34 insertions, 34 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index b9d8d8607773..cf4b02c15bbd 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -94,15 +94,15 @@ namespace sfx2 class SfxLinkItem : public SfxPoolItem { - Link aLink; + Link<> aLink; public: virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const SAL_OVERRIDE { return new SfxLinkItem( *this ); } virtual bool operator==( const SfxPoolItem& rL) const SAL_OVERRIDE { return static_cast<const SfxLinkItem&>(rL).aLink == aLink; } - SfxLinkItem( sal_uInt16 nWhichId, const Link& rValue ) : SfxPoolItem( nWhichId ) + SfxLinkItem( sal_uInt16 nWhichId, const Link<>& rValue ) : SfxPoolItem( nWhichId ) { aLink = rValue; } - const Link& GetValue() const { return aLink; } + const Link<>& GetValue() const { return aLink; } }; #ifndef SFX_DECL_OBJECTSHELL_DEFINED diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 99feed27df20..9d5e507c8d60 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -167,7 +167,7 @@ struct SingleTabDlgImpl VclPtr<SfxTabPage> m_pSfxPage; VclPtr<FixedLine> m_pLine; OUString m_sInfoURL; - Link m_aInfoLink; + Link<> m_aInfoLink; SingleTabDlgImpl(); }; diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index babea564b5df..ff40465676f0 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -438,7 +438,7 @@ private: SvNumberFormatter m_aNumberFormatter; Idle m_aEditLoseFocusIdle; Idle m_aBoxLoseFocusIdle; - Link m_aRemovedHdl; + Link<> m_aRemovedHdl; DECL_LINK( TypeHdl, CustomPropertiesTypeBox* ); DECL_LINK( RemoveHdl, CustomPropertiesRemoveButton* ); @@ -470,7 +470,7 @@ public: ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetCustomProperties() const; - void SetRemovedHdl( const Link& rLink ) { m_aRemovedHdl = rLink; } + void SetRemovedHdl( const Link<>& rLink ) { m_aRemovedHdl = rLink; } void InitRemoveButton(const ScrollBar &rScrollBar); void updateLineWidth(); diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index f6f4fb16669c..389829fec857 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -135,8 +135,8 @@ public: const OUString& GetPhysicalName() const; SAL_WARN_UNUSED_RESULT bool IsRemote() const; SAL_WARN_UNUSED_RESULT bool IsOpen() const; // { return aStorage.Is() || pInStream; } - void Download( const Link& aLink = Link()); - void SetDoneLink( const Link& rLink ); + void Download( const Link<>& aLink = Link<>()); + void SetDoneLink( const Link<>& rLink ); sal_uInt32 GetErrorCode() const; sal_uInt32 GetError() const diff --git a/include/sfx2/docinsert.hxx b/include/sfx2/docinsert.hxx index 62d43deee264..95108a24b8d7 100644 --- a/include/sfx2/docinsert.hxx +++ b/include/sfx2/docinsert.hxx @@ -39,7 +39,7 @@ class SFX2_DLLPUBLIC DocumentInserter private: OUString m_sDocFactory; OUString m_sFilter; - Link m_aDialogClosedLink; + Link<> m_aDialogClosedLink; sal_Int64 const m_nDlgFlags; ErrCode m_nError; @@ -55,7 +55,7 @@ public: bool const bEnableMultiSelection = false); ~DocumentInserter(); - void StartExecuteModal( const Link& _rDialogClosedLink ); + void StartExecuteModal( const Link<>& _rDialogClosedLink ); SfxMedium* CreateMedium(); SfxMediumList* CreateMediumList(); diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx index 6254094fc2a2..53a4fc3fafc5 100644 --- a/include/sfx2/filedlghelper.hxx +++ b/include/sfx2/filedlghelper.hxx @@ -92,7 +92,7 @@ public: }; private: - Link m_aDialogClosedLink; + Link<> m_aDialogClosedLink; ErrCode m_nError; ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePickerListener > mxImp; @@ -131,7 +131,7 @@ public: virtual ~FileDialogHelper(); ErrCode Execute(); - void StartExecuteModal( const Link& rEndDialogHdl ); + void StartExecuteModal( const Link<>& rEndDialogHdl ); inline ErrCode GetError() const { return m_nError; } sal_Int16 GetDialogType() const; bool IsPasswordEnabled() const; diff --git a/include/sfx2/genlink.hxx b/include/sfx2/genlink.hxx index b9e23e5127e9..5c738e3dd902 100644 --- a/include/sfx2/genlink.hxx +++ b/include/sfx2/genlink.hxx @@ -25,13 +25,13 @@ typedef long (*CFuncPtr)(void*); class GenLink { - Link aLink; + Link<> aLink; CFuncPtr pFunc; public: GenLink(): pFunc(0) {} GenLink( CFuncPtr pCFunc ): pFunc(pCFunc) {} - GenLink( const Link& rLink ): aLink(rLink), pFunc(0) {} + GenLink( const Link<>& rLink ): aLink(rLink), pFunc(0) {} GenLink( const GenLink& rOrig ): aLink(rOrig.aLink), pFunc(rOrig.pFunc) {} diff --git a/include/sfx2/linksrc.hxx b/include/sfx2/linksrc.hxx index c39e5310ef67..0a2fbc163db3 100644 --- a/include/sfx2/linksrc.hxx +++ b/include/sfx2/linksrc.hxx @@ -85,7 +85,7 @@ public: virtual bool IsDataComplete() const; // Link impl: DECL_LINK( MyEndEditHdl, sfx2::FileDialogHelper* ); <= param is the dialog - virtual void Edit( vcl::Window *, SvBaseLink *, const Link& rEndEditHdl ); + virtual void Edit( vcl::Window *, SvBaseLink *, const Link<>& rEndEditHdl ); void AddDataAdvise( SvBaseLink *, const rtl::OUString & rMimeType, diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx index 4b04b34eb4a9..3cac2f58934a 100644 --- a/include/sfx2/lnkbase.hxx +++ b/include/sfx2/lnkbase.hxx @@ -146,7 +146,7 @@ public: void Disconnect(); // Link impl: DECL_LINK( MyEndDialogHdl, SvBaseLink* ); <= param is this - virtual void Edit( vcl::Window*, const Link& rEndEditHdl ); + virtual void Edit( vcl::Window*, const Link<>& rEndEditHdl ); // should the link appear in the dialog? (to the left in the link in the...) bool IsVisible() const { return bVisible; } diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index 799f7b40662e..0c91fab65ccd 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -79,7 +79,7 @@ public: class SfxAbstractApplyTabDialog : virtual public SfxAbstractTabDialog { public: - virtual void SetApplyHdl( const Link& rLink ) = 0; + virtual void SetApplyHdl( const Link<>& rLink ) = 0; }; class SfxAbstractInsertObjectDialog : virtual public VclAbstractDialog diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 88a05b95ea30..6a4f18445159 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -207,14 +207,14 @@ public: void RemoveStandardButton(); short Execute() SAL_OVERRIDE; - void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE; + void StartExecuteModal( const Link<>& rEndDialogHdl ) SAL_OVERRIDE; void Start( bool bShow = true ); const SfxItemSet* GetExampleSet() const { return pExampleSet; } SfxItemSet* GetExampleSet() { return pExampleSet; } SfxViewFrame* GetViewFrame() const { return pFrame; } - void SetApplyHandler(const Link& _rHdl); + void SetApplyHandler(const Link<>& _rHdl); SAL_DLLPRIVATE void Start_Impl(); diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx index 402d0c1df6e6..9de550e2b437 100644 --- a/include/sfx2/tbxctrl.hxx +++ b/include/sfx2/tbxctrl.hxx @@ -104,7 +104,7 @@ class SFX2_DLLPUBLIC SfxPopupWindow: public FloatingWindow, public SfxStatusList { bool m_bFloating; bool m_bCascading; - Link m_aDeleteLink; + Link<> m_aDeleteLink; sal_uInt16 m_nId; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; SfxFrameStatusListener* m_pStatusListener; @@ -157,7 +157,7 @@ public: virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE; void StartCascading(); - SAL_DLLPRIVATE void SetDeleteLink_Impl( const Link& rLink ) + SAL_DLLPRIVATE void SetDeleteLink_Impl( const Link<>& rLink ) { m_aDeleteLink = rLink; } diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx index e7ce608606fd..d85e45a21f52 100644 --- a/include/sfx2/templateabstractview.hxx +++ b/include/sfx2/templateabstractview.hxx @@ -115,9 +115,9 @@ public: // Check if the root region is visible or not. bool isNonRootRegionVisible () const { return mnCurRegionId > 0;} - void setOpenRegionHdl(const Link &rLink); + void setOpenRegionHdl(const Link<> &rLink); - void setOpenTemplateHdl (const Link &rLink); + void setOpenTemplateHdl (const Link<> &rLink); static BitmapEx scaleImg (const BitmapEx &rImg, long width, long height); @@ -141,8 +141,8 @@ protected: VclPtr<PushButton> maAllButton; VclPtr<FixedText> maFTName; - Link maOpenRegionHdl; - Link maOpenTemplateHdl; + Link<> maOpenRegionHdl; + Link<> maOpenTemplateHdl; }; #endif // INCLUDED_SFX2_TEMPLATEABSTRACTVIEW_HXX diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index 913aed308a34..7a04eb2daef2 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -241,7 +241,7 @@ public: void sortItems (const boost::function<bool (const ThumbnailViewItem*, const ThumbnailViewItem*) > &func); - void setItemStateHdl (const Link &aLink) { maItemStateHdl = aLink; } + void setItemStateHdl (const Link<> &aLink) { maItemStateHdl = aLink; } virtual void Resize() SAL_OVERRIDE; @@ -329,7 +329,7 @@ protected: bool mbShowTooltips : 1; Color maColor; - Link maItemStateHdl; + Link<> maItemStateHdl; ThumbnailItemAttributes *mpItemAttrs; drawinglayer::processor2d::BaseProcessor2D *mpProcessor; boost::function<bool (const ThumbnailViewItem*) > maFilterFunc; diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index a4c7bbcdb920..48238af77081 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -120,7 +120,7 @@ public: const Point& getPrev1Pos () const { return maPrev1Pos; } - void setSelectClickHdl (const Link &link); + void setSelectClickHdl (const Link<> &link); virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor, const ThumbnailItemAttributes *pAttrs); @@ -136,7 +136,7 @@ protected: Point maTextPos; Point maPrev1Pos; Rectangle maDrawArea; - Link maClickHdl; + Link<> maClickHdl; bool mbEditTitle; VclPtr<VclMultiLineEdit> mpTitleED; Rectangle maTextEditMaxArea; diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx index e09884f1954e..f86245c69de6 100644 --- a/include/sfx2/titledockwin.hxx +++ b/include/sfx2/titledockwin.hxx @@ -61,13 +61,13 @@ namespace sfx2 @return the ID of the newly created toolbox item */ - sal_uInt16 AddDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback ) + sal_uInt16 AddDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link<>& i_rCallback ) { return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback ); } - void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; } - const Link& GetEndDockingHdl() const { return m_aEndDockingHdl; } + void SetEndDockingHdl( const Link<>& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; } + const Link<>& GetEndDockingHdl() const { return m_aEndDockingHdl; } /** resets the toolbox. Upon return, the only item in the toolbox is the closer. */ @@ -111,7 +111,7 @@ namespace sfx2 /** internal version of AddDropDownToolBoxItem */ - sal_uInt16 impl_addDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback ); + sal_uInt16 impl_addDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link<>& i_rCallback ); /** returns the current title. @@ -131,7 +131,7 @@ namespace sfx2 VclPtr<ToolBox> m_aToolbox; VclPtr<Window> m_aContentWindow; - Link m_aEndDockingHdl; + Link<> m_aEndDockingHdl; /** The border that is painted around the inner window. The bevel shadow lines are part of the border, so where the border is 0 no |