summaryrefslogtreecommitdiff
path: root/fpicker
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 /fpicker
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 'fpicker')
-rw-r--r--fpicker/source/office/PlacesListBox.cxx4
-rw-r--r--fpicker/source/office/PlacesListBox.hxx4
-rw-r--r--fpicker/source/office/iodlg.cxx4
-rw-r--r--fpicker/source/office/iodlg.hxx32
-rw-r--r--fpicker/source/office/iodlgimp.hxx4
5 files changed, 24 insertions, 24 deletions
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index 5d75edd0e095..b6ae4eb1c492 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -140,12 +140,12 @@ void PlacesListBox::RemoveSelectedPlace() {
RemovePlace(mpImpl->GetCurrRow());
}
-void PlacesListBox::SetAddHdl( const Link& rHdl )
+void PlacesListBox::SetAddHdl( const Link<>& rHdl )
{
mpAddBtn->SetClickHdl( rHdl );
}
-void PlacesListBox::SetDelHdl( const Link& rHdl )
+void PlacesListBox::SetDelHdl( const Link<>& rHdl )
{
mpDelBtn->SetClickHdl( rHdl );
}
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index 0cf700d6b142..0d2a4742a958 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -60,8 +60,8 @@ class PlacesListBox : public Control
bool IsUpdated();
const std::vector<PlacePtr>& GetPlaces() { return maPlaces;}
- void SetAddHdl( const Link& rHdl );
- void SetDelHdl( const Link& rHdl );
+ void SetAddHdl( const Link<>& rHdl );
+ void SetDelHdl( const Link<>& rHdl );
void SetDelEnabled( bool enabled );
void SetSizePixel( const Size& rNewSize ) SAL_OVERRIDE;
void updateView( );
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 993fd4b88d11..6c6dc7602734 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -426,7 +426,7 @@ void SvtFileDialog::dispose()
makeAny( sUserData ) );
}
- _pFileView->SetSelectHdl( Link() );
+ _pFileView->SetSelectHdl( Link<>() );
// Save bookmarked places
if(_pImp->_pPlaces->IsUpdated()) {
@@ -1752,7 +1752,7 @@ short SvtFileDialog::Execute()
}
-void SvtFileDialog::StartExecuteModal( const Link& rEndDialogHdl )
+void SvtFileDialog::StartExecuteModal( const Link<>& rEndDialogHdl )
{
PrepareExecute();
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index d25ce831110e..4f345799fcf0 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -164,9 +164,9 @@ protected:
void EnableInternet( bool bInternet );
// originally from VclFileDialog
- Link _aOKHdl;
- Link _aFileSelectHdl;
- Link _aFilterSelectHdl;
+ Link<> _aOKHdl;
+ Link<> _aFileSelectHdl;
+ Link<> _aFilterSelectHdl;
OUString _aPath;
OUString _aDefExt;
@@ -197,7 +197,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
- virtual void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE;
+ virtual void StartExecuteModal( const Link<>& rEndDialogHdl ) SAL_OVERRIDE;
void FileSelect();
void FilterSelect();
@@ -259,12 +259,12 @@ public:
inline void SetDefaultExt( const OUString& rExt );
inline void EraseDefaultExt( sal_Int32 _nIndex = 0 );
inline const OUString& GetDefaultExt() const;
- inline void SetOKHdl( const Link& rLink );
- inline const Link& GetOKHdl() const;
- inline void SetFileSelectHdl( const Link& rLink );
- inline const Link& GetFileSelectHdl() const;
- inline void SetFilterSelectHdl( const Link& rLink );
- inline const Link& GetFilterSelectHdl() const;
+ inline void SetOKHdl( const Link<>& rLink );
+ inline const Link<>& GetOKHdl() const;
+ inline void SetFileSelectHdl( const Link<>& rLink );
+ inline const Link<>& GetFileSelectHdl() const;
+ inline void SetFilterSelectHdl( const Link<>& rLink );
+ inline const Link<>& GetFilterSelectHdl() const;
inline Image GetButtonImage( sal_uInt16 _nButtonId ) const { return m_aImages.GetImage( _nButtonId ); }
@@ -370,7 +370,7 @@ inline const OUString& SvtFileDialog::GetDefaultExt() const
inline void SvtFileDialog::SetOKHdl
(
- const Link& rLink
+ const Link<>& rLink
)
{
_aOKHdl = rLink;
@@ -378,7 +378,7 @@ inline void SvtFileDialog::SetOKHdl
-inline const Link& SvtFileDialog::GetOKHdl() const
+inline const Link<>& SvtFileDialog::GetOKHdl() const
{
return _aOKHdl;
}
@@ -387,7 +387,7 @@ inline const Link& SvtFileDialog::GetOKHdl() const
inline void SvtFileDialog::SetFileSelectHdl
(
- const Link& rLink
+ const Link<>& rLink
)
{
_aFileSelectHdl = rLink;
@@ -395,7 +395,7 @@ inline void SvtFileDialog::SetFileSelectHdl
-inline const Link& SvtFileDialog::GetFileSelectHdl() const
+inline const Link<>& SvtFileDialog::GetFileSelectHdl() const
{
return _aFileSelectHdl;
}
@@ -404,7 +404,7 @@ inline const Link& SvtFileDialog::GetFileSelectHdl() const
inline void SvtFileDialog::SetFilterSelectHdl
(
- const Link& rLink
+ const Link<>& rLink
)
{
_aFilterSelectHdl = rLink;
@@ -412,7 +412,7 @@ inline void SvtFileDialog::SetFilterSelectHdl
-inline const Link& SvtFileDialog::GetFilterSelectHdl() const
+inline const Link<>& SvtFileDialog::GetFilterSelectHdl() const
{
return _aFilterSelectHdl;
}
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 04b986453a21..dd6244b4fe21 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -199,7 +199,7 @@ public:
// access to the filter listbox only as Control* - we want to maintain the entries/userdata ourself
Control* GetFilterListControl() { return _pLbFilter; }
const Control* GetFilterListControl() const { return _pLbFilter; }
- inline void SetFilterListSelectHdl( const Link& _rHandler );
+ inline void SetFilterListSelectHdl( const Link<>& _rHandler );
// inits the listbox for the filters from the filter list (_pFilter)
void ClearFilterList( );
@@ -220,7 +220,7 @@ public:
inline void SetCurFilter( SvtFileDialogFilter_Impl* _pFilter );
};
-inline void SvtExpFileDlg_Impl::SetFilterListSelectHdl( const Link& _rHandler )
+inline void SvtExpFileDlg_Impl::SetFilterListSelectHdl( const Link<>& _rHandler )
{
_pLbFilter->SetSelectHdl( _rHandler );
}