summaryrefslogtreecommitdiff
path: root/chart2
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 /chart2
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 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx22
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx8
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.hxx2
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_Titles.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx4
-rw-r--r--chart2/source/controller/inc/dlg_ObjectProperties.hxx2
-rw-r--r--chart2/source/controller/inc/res_LegendPosition.hxx4
-rw-r--r--chart2/source/controller/inc/res_Titles.hxx2
-rw-r--r--chart2/source/inc/ModifyListenerCallBack.hxx2
-rw-r--r--chart2/source/tools/ModifyListenerCallBack.cxx8
13 files changed, 31 insertions, 31 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 7c7b8f30deec..1d2eebca3d5f 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -171,9 +171,9 @@ public:
*/
void applyChanges();
- void SetGetFocusHdl( const Link& rLink );
+ void SetGetFocusHdl( const Link<>& rLink );
- void SetEditChangedHdl( const Link & rLink );
+ void SetEditChangedHdl( const Link<> & rLink );
bool HasFocus() const;
@@ -182,7 +182,7 @@ private:
VclPtr< SeriesHeaderEdit > m_spSeriesName;
VclPtr< FixedText > m_spColorBar;
VclPtr< OutputDevice> m_pDevice;
- Link m_aChangeLink;
+ Link<> m_aChangeLink;
void notifyChanges();
DECL_LINK( SeriesNameChanged, void * );
@@ -316,7 +316,7 @@ void SeriesHeader::Hide()
m_spColorBar->Hide();
}
-void SeriesHeader::SetEditChangedHdl( const Link & rLink )
+void SeriesHeader::SetEditChangedHdl( const Link<> & rLink )
{
m_aChangeLink = rLink;
}
@@ -333,7 +333,7 @@ IMPL_LINK_NOARG(SeriesHeader, SeriesNameEdited)
return 0;
}
-void SeriesHeader::SetGetFocusHdl( const Link& rLink )
+void SeriesHeader::SetGetFocusHdl( const Link<>& rLink )
{
m_spSeriesName->SetGetFocusHdl( rLink );
}
@@ -585,8 +585,8 @@ void DataBrowser::RenewTable()
// fill series headers
clearHeaders();
const DataBrowserModel::tDataHeaderVector& aHeaders( m_apDataBrowserModel->getDataHeaders());
- Link aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
- Link aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
+ Link<> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
+ Link<> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
aIt != aHeaders.end(); ++aIt )
@@ -745,7 +745,7 @@ void DataBrowser::CursorMoved()
m_aCursorMovedHdlLink.Call( this );
}
-void DataBrowser::SetCellModifiedHdl( const Link& rLink )
+void DataBrowser::SetCellModifiedHdl( const Link<>& rLink )
{
m_aCellModifiedLink = rLink;
}
@@ -965,7 +965,7 @@ void DataBrowser::SwapRow()
}
}
-void DataBrowser::SetCursorMovedHdl( const Link& rLink )
+void DataBrowser::SetCursorMovedHdl( const Link<>& rLink )
{
m_aCursorMovedHdlLink = rLink;
}
@@ -1223,8 +1223,8 @@ void DataBrowser::RenewSeriesHeaders()
clearHeaders();
DataBrowserModel::tDataHeaderVector aHeaders( m_apDataBrowserModel->getDataHeaders());
- Link aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
- Link aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
+ Link<> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
+ Link<> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
aIt != aHeaders.end(); ++aIt )
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index 8a721c428067..948fa30dd949 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -127,9 +127,9 @@ public:
void SwapRow();
void SwapColumn();
- void SetCursorMovedHdl( const Link& rLink );
+ void SetCursorMovedHdl( const Link<>& rLink );
- void SetCellModifiedHdl( const Link& rLink );
+ void SetCellModifiedHdl( const Link<>& rLink );
/// confirms all pending changes to be ready to be closed
bool EndEditing();
@@ -173,8 +173,8 @@ private:
/// note: m_aTextEditField must precede this member!
::svt::CellControllerRef m_rTextEditController;
- Link m_aCursorMovedHdlLink;
- Link m_aCellModifiedLink;
+ Link<> m_aCursorMovedHdlLink;
+ Link<> m_aCellModifiedLink;
void clearHeaders();
void RenewTable();
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx
index 725b2cc5d82b..dd3db5ea65c6 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.cxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx
@@ -28,7 +28,7 @@ BarGeometryResources::BarGeometryResources(VclBuilderContainer* pWindow)
pWindow->get(m_pLB_Geometry, "shape");
}
-void BarGeometryResources::SetSelectHdl( const Link& rLink )
+void BarGeometryResources::SetSelectHdl( const Link<>& rLink )
{
m_pLB_Geometry->SetSelectHdl( rLink );
}
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.hxx b/chart2/source/controller/dialogs/res_BarGeometry.hxx
index 7a9eeb8c17f8..a14cf4a59fa7 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.hxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.hxx
@@ -38,7 +38,7 @@ public:
sal_Int32 GetSelectEntryPos() const;
void SelectEntryPos(sal_Int32 nPos);
- void SetSelectHdl( const Link& rLink );
+ void SetSelectHdl( const Link<>& rLink );
private:
VclPtr<FixedText> m_pFT_Geometry;
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index fe05befe5fa1..ce21c1c31c88 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -237,7 +237,7 @@ IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
return 0;
}
-void LegendPositionResources::SetChangeHdl( const Link& rLink )
+void LegendPositionResources::SetChangeHdl( const Link<>& rLink )
{
m_aChangeLink = rLink;
}
diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx
index a00cae54bd7b..5186acf1ddcd 100644
--- a/chart2/source/controller/dialogs/res_Titles.cxx
+++ b/chart2/source/controller/dialogs/res_Titles.cxx
@@ -54,7 +54,7 @@ TitleResources::~TitleResources()
{
}
-void TitleResources::SetUpdateDataHdl( const Link& rLink )
+void TitleResources::SetUpdateDataHdl( const Link<>& rLink )
{
sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 74ea1b2656c1..acc8d0872502 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -69,7 +69,7 @@ TrendlineResources::TrendlineResources( vcl::Window * pParent, const SfxItemSet&
pTabPage->get(m_pFI_MovingAverage,"imageMovingAverage");
FillValueSets();
- Link aLink = LINK(this, TrendlineResources, SelectTrendLine );
+ Link<> aLink = LINK(this, TrendlineResources, SelectTrendLine );
m_pRB_Linear->SetClickHdl( aLink );
m_pRB_Logarithmic->SetClickHdl( aLink );
m_pRB_Exponential->SetClickHdl( aLink );
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index e3988f975ebf..7c76e18a6e12 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -100,8 +100,8 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow
m_pMFZRotation->SetValue(m_nZRotation);
const sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
- Link aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged ));
- Link aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited ));
+ Link<> aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged ));
+ Link<> aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited ));
m_pMFXRotation->EnableUpdateData( nTimeout );
m_pMFXRotation->SetUpdateDataHdl( aAngleChangedLink );
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 8ad9fc95525d..0119c3d033c6 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -122,7 +122,7 @@ private:
virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage) SAL_OVERRIDE;
- Link m_aOriginalOKClickHdl;
+ Link<> m_aOriginalOKClickHdl;
DECL_LINK( OKPressed, void * );
public:
diff --git a/chart2/source/controller/inc/res_LegendPosition.hxx b/chart2/source/controller/inc/res_LegendPosition.hxx
index 7801895a6308..b9f6dfec702b 100644
--- a/chart2/source/controller/inc/res_LegendPosition.hxx
+++ b/chart2/source/controller/inc/res_LegendPosition.hxx
@@ -48,7 +48,7 @@ public:
void initFromItemSet( const SfxItemSet& rInAttrs );
void writeToItemSet( SfxItemSet& rOutAttrs ) const;
- void SetChangeHdl( const Link& rLink );
+ void SetChangeHdl( const Link<>& rLink );
DECL_LINK( PositionEnableHdl, void* );
DECL_LINK( PositionChangeHdl, RadioButton* );
@@ -67,7 +67,7 @@ private:
VclPtr<RadioButton> m_pRbtTop;
VclPtr<RadioButton> m_pRbtBottom;
- Link m_aChangeLink;
+ Link<> m_aChangeLink;
};
} //namespace chart
diff --git a/chart2/source/controller/inc/res_Titles.hxx b/chart2/source/controller/inc/res_Titles.hxx
index 396c87af598f..05e22efd4e35 100644
--- a/chart2/source/controller/inc/res_Titles.hxx
+++ b/chart2/source/controller/inc/res_Titles.hxx
@@ -35,7 +35,7 @@ public:
void writeToResources( const TitleDialogData& rInput );
void readFromResources( TitleDialogData& rOutput );
- void SetUpdateDataHdl( const Link& rLink );
+ void SetUpdateDataHdl( const Link<>& rLink );
bool IsModified();
void ClearModifyFlag();
diff --git a/chart2/source/inc/ModifyListenerCallBack.hxx b/chart2/source/inc/ModifyListenerCallBack.hxx
index e992d7d11db0..8f5b6c54afbe 100644
--- a/chart2/source/inc/ModifyListenerCallBack.hxx
+++ b/chart2/source/inc/ModifyListenerCallBack.hxx
@@ -36,7 +36,7 @@ class ModifyListenerCallBack_impl;
class OOO_DLLPUBLIC_CHARTTOOLS ModifyListenerCallBack
{
public:
- explicit ModifyListenerCallBack( const Link& rCallBack );
+ explicit ModifyListenerCallBack( const Link<>& rCallBack );
virtual ~ModifyListenerCallBack();
diff --git a/chart2/source/tools/ModifyListenerCallBack.cxx b/chart2/source/tools/ModifyListenerCallBack.cxx
index fe5e0c73c6ae..240eb3e168bc 100644
--- a/chart2/source/tools/ModifyListenerCallBack.cxx
+++ b/chart2/source/tools/ModifyListenerCallBack.cxx
@@ -35,7 +35,7 @@ class ModifyListenerCallBack_impl
, public ModifyListenerCallBack_Base
{
public:
- explicit ModifyListenerCallBack_impl( const Link& rCallBack );
+ explicit ModifyListenerCallBack_impl( const Link<>& rCallBack );
virtual ~ModifyListenerCallBack_impl();
void stopListening();
@@ -49,11 +49,11 @@ public:
using ::cppu::WeakComponentImplHelperBase::disposing;
private:
- Link m_aLink;//will be callef on modify
+ Link<> m_aLink;//will be callef on modify
Reference< util::XModifyBroadcaster > m_xBroadcaster;//broadcaster to listen at
};
-ModifyListenerCallBack_impl::ModifyListenerCallBack_impl( const Link& rCallBack )
+ModifyListenerCallBack_impl::ModifyListenerCallBack_impl( const Link<>& rCallBack )
: ModifyListenerCallBack_Base( m_aMutex )
, m_aLink( rCallBack )
, m_xBroadcaster(0)
@@ -85,7 +85,7 @@ void ModifyListenerCallBack_impl::stopListening()
}
}
-ModifyListenerCallBack::ModifyListenerCallBack( const Link& rCallBack )
+ModifyListenerCallBack::ModifyListenerCallBack( const Link<>& rCallBack )
: pModifyListener_impl( new ModifyListenerCallBack_impl(rCallBack) )
, m_xModifyListener( pModifyListener_impl )
{