From 411e32244c7bff5fb64a049b1c63cf15ac166cd3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 2 Sep 2015 15:59:16 +0200 Subject: convert Link<> to typed Change-Id: Ic15d0539aa00b46694a1715b6dda9d78bb1c00d8 Reviewed-on: https://gerrit.libreoffice.org/18269 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- basctl/source/basicide/layout.cxx | 4 +--- basctl/source/basicide/layout.hxx | 2 +- dbaccess/source/ui/browser/brwview.cxx | 4 +--- dbaccess/source/ui/control/VertSplitView.cxx | 3 +-- dbaccess/source/ui/inc/JoinDesignView.hxx | 4 +++- dbaccess/source/ui/inc/QueryDesignView.hxx | 2 +- dbaccess/source/ui/inc/TableDesignView.hxx | 2 +- dbaccess/source/ui/inc/VertSplitView.hxx | 2 +- dbaccess/source/ui/inc/brwview.hxx | 2 +- dbaccess/source/ui/inc/querycontainerwindow.hxx | 2 +- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 3 +-- dbaccess/source/ui/querydesign/querycontainerwindow.cxx | 4 +--- dbaccess/source/ui/tabledesign/TableDesignView.cxx | 3 +-- fpicker/source/office/RemoteFilesDialog.cxx | 4 +--- fpicker/source/office/RemoteFilesDialog.hxx | 2 +- fpicker/source/office/iodlg.cxx | 3 +-- fpicker/source/office/iodlg.hxx | 2 +- include/vcl/split.hxx | 12 ++++++------ reportdesign/source/ui/inc/SectionWindow.hxx | 6 +++--- reportdesign/source/ui/report/SectionWindow.cxx | 12 ++++-------- sc/source/ui/inc/tabview.hxx | 2 +- sc/source/ui/view/tabview.cxx | 4 +--- svx/inc/GalleryControl.hxx | 3 ++- svx/source/gallery2/GalleryControl.cxx | 4 +--- 24 files changed, 37 insertions(+), 54 deletions(-) diff --git a/basctl/source/basicide/layout.cxx b/basctl/source/basicide/layout.cxx index 43813e267770..fb29deeb2747 100644 --- a/basctl/source/basicide/layout.cxx +++ b/basctl/source/basicide/layout.cxx @@ -365,7 +365,7 @@ void Layout::SplittedSide::ArrangeIn (Rectangle const& rRect) } } -IMPL_LINK(Layout::SplittedSide, SplitHdl, Splitter*, pSplitter) +IMPL_LINK_TYPED(Layout::SplittedSide, SplitHdl, Splitter*, pSplitter, void) { // checking margins CheckMarginsFor(pSplitter); @@ -394,8 +394,6 @@ IMPL_LINK(Layout::SplittedSide, SplitHdl, Splitter*, pSplitter) } // arranging windows rLayout.ArrangeWindows(); - - return 0; } void Layout::SplittedSide::CheckMarginsFor (Splitter* pSplitter) diff --git a/basctl/source/basicide/layout.hxx b/basctl/source/basicide/layout.hxx index 6d949c737a17..bf34ae68ff2e 100644 --- a/basctl/source/basicide/layout.hxx +++ b/basctl/source/basicide/layout.hxx @@ -120,7 +120,7 @@ private: Point MakePoint (long, long) const; Size MakeSize (long, long) const; static bool IsDocking (DockingWindow const&); - DECL_LINK(SplitHdl, Splitter*); + DECL_LINK_TYPED(SplitHdl, Splitter*, void); void CheckMarginsFor (Splitter*); void InitSplitter (Splitter&); } aLeftSide, aBottomSide; diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index f702fe55c1c6..aad77d2e31d8 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -139,13 +139,11 @@ void UnoDataBrowserView::dispose() ODataView::dispose(); } -IMPL_LINK_NOARG( UnoDataBrowserView, SplitHdl ) +IMPL_LINK_NOARG_TYPED( UnoDataBrowserView, SplitHdl, Splitter*, void ) { long nYPos = m_pSplitter->GetPosPixel().Y(); m_pSplitter->SetPosPixel( Point( m_pSplitter->GetSplitPosPixel(), nYPos ) ); Resize(); - - return 0L; } void UnoDataBrowserView::setSplitter(Splitter* _pSplitter) diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx index 469536b9af6f..d13f0bc8d248 100644 --- a/dbaccess/source/ui/control/VertSplitView.cxx +++ b/dbaccess/source/ui/control/VertSplitView.cxx @@ -50,7 +50,7 @@ void OSplitterView::dispose() vcl::Window::dispose(); } -IMPL_LINK( OSplitterView, SplitHdl, Splitter*, /*pSplit*/ ) +IMPL_LINK_NOARG_TYPED( OSplitterView, SplitHdl, Splitter*, void ) { OSL_ENSURE(m_pSplitter, "Splitter is NULL!"); if ( m_bVertical ) @@ -62,7 +62,6 @@ IMPL_LINK( OSplitterView, SplitHdl, Splitter*, /*pSplit*/ ) m_pSplitter->SetPosPixel( Point( m_pSplitter->GetPosPixel().X(),m_pSplitter->GetSplitPosPixel() ) ); Resize(); - return 0L; } void OSplitterView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx index a292b36001ec..4a22a2a02994 100644 --- a/dbaccess/source/ui/inc/JoinDesignView.hxx +++ b/dbaccess/source/ui/inc/JoinDesignView.hxx @@ -23,6 +23,8 @@ #include #include "QEnumTypes.hxx" +class Splitter; + namespace dbaui { class OJoinController; @@ -61,7 +63,7 @@ namespace dbaui protected: // return the Rectangle where I can paint myself virtual void resizeDocumentView(Rectangle& rRect) SAL_OVERRIDE; - DECL_LINK( SplitHdl, void* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); }; } #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_JOINDESIGNVIEW_HXX diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 64d8fae01233..d54b74a7c517 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -151,7 +151,7 @@ namespace dbaui protected: // return the Rectangle where I can paint myself virtual void resizeDocumentView(Rectangle& rRect) SAL_OVERRIDE; - DECL_LINK( SplitHdl, void* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); private: using OQueryView::SaveTabWinUIConfig; diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 8b960403a723..9a6fbec1aa73 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -38,7 +38,7 @@ namespace dbaui void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); void ArrangeChildren( long nSplitPos ,Rectangle& rRect); - DECL_LINK( SplitHdl, Splitter* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt) SAL_OVERRIDE; public: diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index ac7bde548eed..dcc6deddedc3 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -33,7 +33,7 @@ namespace dbaui bool m_bVertical; void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); - DECL_LINK( SplitHdl, Splitter* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt) SAL_OVERRIDE; public: diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index 4b350c89b125..4c116418f397 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -51,7 +51,7 @@ namespace dbaui mutable VclPtr m_pVclControl; // our grid's VCL representation VclPtr m_pStatus; - DECL_LINK( SplitHdl, void* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); // attribute access public: css::uno::Reference< css::awt::XControl > getGridControl() const { return m_xGrid; } diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx index 735e60ed0f16..fd84eb52b293 100644 --- a/dbaccess/source/ui/inc/querycontainerwindow.hxx +++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx @@ -46,7 +46,7 @@ namespace dbaui VclPtr m_pSplitter; css::uno::Reference< css::frame::XFrame2 > m_xBeamer; - DECL_LINK( SplitHdl, void* ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); public: OQueryContainerWindow(vcl::Window* pParent, OQueryController& _rController,const css::uno::Reference< css::uno::XComponentContext >&); virtual ~OQueryContainerWindow(); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 7f1932ce502e..764643d7f011 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2527,7 +2527,7 @@ void OQueryDesignView::dispose() OQueryView::dispose(); } -IMPL_LINK_NOARG( OQueryDesignView, SplitHdl ) +IMPL_LINK_NOARG_TYPED( OQueryDesignView, SplitHdl, Splitter*, void ) { if (!getController().isReadOnly()) { @@ -2538,7 +2538,6 @@ IMPL_LINK_NOARG( OQueryDesignView, SplitHdl ) Resize(); m_bInSplitHandler = true; } - return 0L; } void OQueryDesignView::Construct() diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index edf49a59f14d..a3fffc9b179a 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -133,12 +133,10 @@ namespace dbaui if(m_pViewSwitch) m_pViewSwitch->GrabFocus(); } - IMPL_LINK_NOARG( OQueryContainerWindow, SplitHdl ) + IMPL_LINK_NOARG_TYPED( OQueryContainerWindow, SplitHdl, Splitter*, void ) { m_pSplitter->SetPosPixel( Point( m_pSplitter->GetPosPixel().X(),m_pSplitter->GetSplitPosPixel() ) ); Resize(); - - return 0L; } void OQueryContainerWindow::Construct() diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 90e012ff5d93..2c0259037d10 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -105,14 +105,13 @@ void OTableBorderWindow::Resize() Size(nOutputWidth, nOutputHeight-nSplitPos-nSplitterHeight) ); } -IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit ) +IMPL_LINK_TYPED( OTableBorderWindow, SplitHdl, Splitter*, pSplit, void ) { if(pSplit == m_aHorzSplitter.get()) { m_aHorzSplitter->SetPosPixel( Point( m_aHorzSplitter->GetPosPixel().X(),m_aHorzSplitter->GetSplitPosPixel() ) ); Resize(); } - return 0; } void OTableBorderWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index c8ffde084e1d..531ff3492f5c 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -997,7 +997,7 @@ IMPL_LINK_NOARG( RemoteFilesDialog, FileNameModifyHdl ) return 1; } -IMPL_LINK_NOARG ( RemoteFilesDialog, SplitHdl ) +IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SplitHdl, Splitter*, void ) { sal_Int32 nSplitPos = m_pSplitter->GetSplitPosPixel(); @@ -1017,8 +1017,6 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SplitHdl ) m_pFileView->SetPosSizePixel( fileViewPos, fileViewSize ); m_pSplitter->SetPosPixel( Point( placeSize.Width(), m_pSplitter->GetPosPixel().Y() ) ); - - return 1; } IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl ) diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index a1ce0def526e..008695b2d3c1 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -195,7 +195,7 @@ private: DECL_LINK( FileNameGetFocusHdl, void * ); DECL_LINK( FileNameModifyHdl, void * ); - DECL_LINK( SplitHdl, void * ); + DECL_LINK_TYPED( SplitHdl, Splitter*, void ); DECL_LINK( SelectFilterHdl, void * ); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index bee5c608ce51..4c76083d330c 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2797,7 +2797,7 @@ void SvtFileDialog::initDefaultPlaces( ) _pImp->_pPlaces->IsUpdated(); } -IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, Split_Hdl, Splitter*, void ) { sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); @@ -2817,7 +2817,6 @@ IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl ) _pFileView->SetPosSizePixel( fileViewPos, fileViewSize ); _pSplitter->SetPosPixel( Point( placeSize.Width(), _pSplitter->GetPosPixel().Y() ) ); - return 0; } QueryFolderNameDialog::QueryFolderNameDialog(vcl::Window* _pParent, diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 41e8b88a95aa..553fae105ce8 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -98,7 +98,7 @@ private: DECL_LINK_TYPED( AddPlacePressed_Hdl, Button*, void ); DECL_LINK_TYPED( RemovePlacePressed_Hdl, Button*, void ); - DECL_LINK ( Split_Hdl, void* ); + DECL_LINK_TYPED( Split_Hdl, Splitter*, void ); void OpenHdl_Impl(void* pVoid); void Init_Impl( WinBits nBits ); diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx index b12abdda5131..069712aca2cf 100644 --- a/include/vcl/split.hxx +++ b/include/vcl/split.hxx @@ -39,9 +39,9 @@ private: bool mbKbdSplitting; long mbInKeyEvent; long mnKeyboardStepSize; - Link<> maStartSplitHdl; - Link<> maSplitHdl; - Link<> maEndSplitHdl; + Link maStartSplitHdl; + Link maSplitHdl; + Link maEndSplitHdl; SAL_DLLPRIVATE void ImplInitSplitterData(); SAL_DLLPRIVATE void ImplDrawSplitter(); @@ -97,9 +97,9 @@ public: // the default is 10% of the reference window's width/height void SetKeyboardStepSize( long nStepSize ); - void SetStartSplitHdl( const Link<>& rLink ) { maStartSplitHdl = rLink; } - void SetSplitHdl( const Link<>& rLink ) { maSplitHdl = rLink; } - void SetEndSplitHdl( const Link<>& rLink ) { maEndSplitHdl = rLink; } + void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; } + void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; } + void SetEndSplitHdl( const Link& rLink ) { maEndSplitHdl = rLink; } }; #endif // INCLUDED_VCL_SPLIT_HXX diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx index 166c25cd6a48..70a693ad81f2 100644 --- a/reportdesign/source/ui/inc/SectionWindow.hxx +++ b/reportdesign/source/ui/inc/SectionWindow.hxx @@ -81,9 +81,9 @@ namespace rptui void ImplInitSettings(); DECL_LINK(Collapsed,OColorListener*); - DECL_LINK(StartSplitHdl, Splitter*); - DECL_LINK(SplitHdl, Splitter*); - DECL_LINK(EndSplitHdl, Splitter*); + DECL_LINK_TYPED(StartSplitHdl, Splitter*, void); + DECL_LINK_TYPED(SplitHdl, Splitter*, void); + DECL_LINK_TYPED(EndSplitHdl, Splitter*, void); virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 4a66469db58c..deaa0f48c7de 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -321,24 +321,22 @@ void OSectionWindow::zoom(const Fraction& _aZoom) Invalidate(); } -IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, ) +IMPL_LINK_NOARG_TYPED( OSectionWindow, StartSplitHdl, Splitter*, void) { const OUString sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) ); getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction( sUndoAction, OUString() ); - return 0L; } -IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, ) +IMPL_LINK_NOARG_TYPED( OSectionWindow, EndSplitHdl, Splitter*, void ) { getViewsWindow()->getView()->getReportView()->getController().getUndoManager().LeaveListAction(); - return 0L; } -IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) +IMPL_LINK_TYPED( OSectionWindow, SplitHdl, Splitter*, _pSplitter, void ) { if ( !getViewsWindow()->getView()->getReportView()->getController().isEditable() ) { - return 0L; + return; } sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); @@ -361,8 +359,6 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) xSection->setHeight(nSplitPos); m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,nSplitPos)).Height()); - - return 0L; } void lcl_scroll(vcl::Window& _rWindow,const Point& _aDelta) diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 40a4c430b6fa..6ad122d147dc 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -173,7 +173,7 @@ private: DECL_LINK( ScrollHdl, ScrollBar* ); DECL_LINK( EndScrollHdl, void* ); - DECL_LINK( SplitHdl, Splitter* ); + DECL_LINK_TYPED(SplitHdl, Splitter*, void); void DoHSplit(long nSplitPos); void DoVSplit(long nSplitPos); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index a273d9c2851d..1aa3e4d0220b 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1541,7 +1541,7 @@ bool ScTabView::UpdateVisibleRange() // --- Splitter -------------------------------------------------------- -IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter ) +IMPL_LINK_TYPED( ScTabView, SplitHdl, Splitter*, pSplitter, void ) { if ( pSplitter == pHSplitter ) DoHSplit( pHSplitter->GetSplitPosPixel() ); @@ -1552,8 +1552,6 @@ IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter ) FreezeSplitters( true ); DoResize( aBorderPos, aFrameSize ); - - return 0; } void ScTabView::DoHSplit(long nSplitPos) diff --git a/svx/inc/GalleryControl.hxx b/svx/inc/GalleryControl.hxx index a807b05dbea8..268aba405abd 100644 --- a/svx/inc/GalleryControl.hxx +++ b/svx/inc/GalleryControl.hxx @@ -33,6 +33,7 @@ class GallerySplitter; class GalleryBrowser1; class GalleryBrowser2; class FmFormModel; +class Splitter; namespace svx { namespace sidebar { @@ -59,7 +60,7 @@ private: virtual void Resize() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; - DECL_LINK(SplitHdl, void*); + DECL_LINK_TYPED(SplitHdl, Splitter*, void); protected: void ThemeSelectionHasChanged(); diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index 66440e7809c7..b06cd4d259e9 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -226,7 +226,7 @@ void GalleryControl::ThemeSelectionHasChanged() mpBrowser2->SelectTheme(mpBrowser1->GetSelectedTheme()); } -IMPL_LINK_NOARG( GalleryControl, SplitHdl ) +IMPL_LINK_NOARG_TYPED( GalleryControl, SplitHdl, Splitter*, void ) { if(mpSplitter->IsHorizontal()) { @@ -238,8 +238,6 @@ IMPL_LINK_NOARG( GalleryControl, SplitHdl ) } Resize(); - - return 0L; } -- cgit