diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-07-18 17:23:17 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-07-20 08:01:58 +0000 |
commit | 91b1f300cf7f357c3a39d0d5810326cc78d78f16 (patch) | |
tree | a89ef37ce86d8fe5babde77a43a098001ca3c164 /sw/source | |
parent | bca4d6f896fb12ceff37476c43ea8892898dd385 (diff) |
convert to typed Link<> in sfx2
Change-Id: Ifa42bd14d7329ff1043fa736513c468dda30485e
Reviewed-on: https://gerrit.libreoffice.org/17195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/inc/conttree.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/javaedit.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/navipi.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/regionsw.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/inc/uivwimp.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/uivwimp.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 69 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 39 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 4 |
11 files changed, 64 insertions, 72 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 6d02cd3b8021..711462e481d2 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1331,7 +1331,7 @@ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) return 0; } -IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) +IMPL_LINK_TYPED( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, void ) { OUString sFileName, sFilterName, sPassword; if ( _pFileDlg->GetError() == ERRCODE_NONE ) @@ -1360,7 +1360,6 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) } Application::SetDefDialogParent( m_pOldDefDlgParent ); - return 0; } IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) @@ -1812,7 +1811,7 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox ) return 0; } -IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) +IMPL_LINK_TYPED( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, void ) { if ( _pFileDlg->GetError() == ERRCODE_NONE ) { @@ -1833,7 +1832,6 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil m_sFilterName = m_sFilePasswd = aEmptyOUStr; Application::SetDefDialogParent( m_pOldDefDlgParent ); - return 0; } SwSectionFootnoteEndTabPage::SwSectionFootnoteEndTabPage( vcl::Window *pParent, diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index ae304ee4194a..c193ba567edf 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -273,7 +273,7 @@ IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn ) return 0; } -IMPL_LINK_NOARG(SwJavaEditDialog, DlgClosedHdl) +IMPL_LINK_NOARG_TYPED(SwJavaEditDialog, DlgClosedHdl, sfx2::FileDialogHelper *, void) { if ( pFileDlg->GetError() == ERRCODE_NONE ) { @@ -286,8 +286,6 @@ IMPL_LINK_NOARG(SwJavaEditDialog, DlgClosedHdl) } m_pUrlED->SetText( sFileName ); } - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 607c8c1ee2d7..8082a86c85b3 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -249,7 +249,7 @@ private: void InsertRegion( const SwGlblDocContent* _pContent, const com::sun::star::uno::Sequence< OUString >& _rFiles ); - DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); + DECL_LINK_TYPED( DialogClosedHdl, sfx2::FileDialogHelper*, void ); using SvTreeListBox::DoubleClickHdl; using SvTreeListBox::ExecuteDrop; diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx index 071faaf87f5a..1958fce891b2 100644 --- a/sw/source/uibase/inc/javaedit.hxx +++ b/sw/source/uibase/inc/javaedit.hxx @@ -61,7 +61,7 @@ private: DECL_LINK(NextHdl, void *); DECL_LINK(RadioButtonHdl, void *); DECL_LINK(InsertFileHdl, PushButton *); - DECL_LINK(DlgClosedHdl, void *); + DECL_LINK_TYPED(DlgClosedHdl, sfx2::FileDialogHelper *, void); virtual void Apply() SAL_OVERRIDE; diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 885a42348012..4a3352308a54 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -111,7 +111,7 @@ class SwNavigationPI : public vcl::Window, DECL_LINK_TYPED( ChangePageHdl, Idle*, void ); DECL_LINK( PageEditModifyHdl, void* ); DECL_LINK( PopupModeEndHdl, void * ); - DECL_LINK( ClosePopupWindow, SfxPopupWindow * ); + DECL_LINK_TYPED( ClosePopupWindow, SfxPopupWindow *, void ); void UsePage(SwWrtShell *); void MakeVisible(); diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx index c4687102da78..d74e06af479a 100644 --- a/sw/source/uibase/inc/regionsw.hxx +++ b/sw/source/uibase/inc/regionsw.hxx @@ -122,7 +122,7 @@ class SwEditRegionDlg : public SfxModalDialog DECL_LINK(OptionsHdl, void *); DECL_LINK( FileNameHdl, Edit* ); DECL_LINK( DDEHdl, CheckBox* ); - DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); + DECL_LINK_TYPED( DlgClosedHdl, sfx2::FileDialogHelper*, void ); DECL_LINK( SubRegionEventHdl, VclWindowEvent * ); bool CheckPasswd(CheckBox* pBox = 0); @@ -177,7 +177,7 @@ class SwInsertSectionTabPage : public SfxTabPage DECL_LINK( UseFileHdl, CheckBox* ); DECL_LINK(FileSearchHdl, void *); DECL_LINK( DDEHdl, CheckBox* ); - DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); + DECL_LINK_TYPED( DlgClosedHdl, sfx2::FileDialogHelper*, void ); public: SwInsertSectionTabPage(vcl::Window *pParent, const SfxItemSet &rAttrSet); diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx index 98d754b1cb2d..16969ef70b51 100644 --- a/sw/source/uibase/inc/uivwimp.hxx +++ b/sw/source/uibase/inc/uivwimp.hxx @@ -166,7 +166,7 @@ public: return m_bEditingPositionSet; } - void StartDocumentInserter( const OUString& rFactory, const Link<>& rEndDialogHdl ); + void StartDocumentInserter( const OUString& rFactory, const Link<sfx2::FileDialogHelper*,void>& rEndDialogHdl ); SfxMedium* CreateMedium(); void InitRequest( const SfxRequest& rRequest ); diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 54ceb1f1cf50..7bb139335027 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -238,7 +238,7 @@ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) rTransferable.m_refCount--; } -void SwView_Impl::StartDocumentInserter( const OUString& rFactory, const Link<>& rEndDialogHdl ) +void SwView_Impl::StartDocumentInserter( const OUString& rFactory, const Link<sfx2::FileDialogHelper*,void>& rEndDialogHdl ) { delete m_pDocInserter; m_pDocInserter = new ::sfx2::DocumentInserter( rFactory ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index e47987fa2194..c993fbb8e59a 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2439,48 +2439,47 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) #endif } -IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) +IMPL_LINK_TYPED( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void ) { - if ( ERRCODE_NONE == _pFileDlg->GetError() ) + if ( ERRCODE_NONE != _pFileDlg->GetError() ) + return; + + SfxMedium* pMed = m_pViewImpl->CreateMedium(); + if ( !pMed ) + return; + + const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot(); + long nFound = InsertMedium( nSlot, pMed, m_pViewImpl->GetParam() ); + + if ( SID_INSERTDOC == nSlot ) { - SfxMedium* pMed = m_pViewImpl->CreateMedium(); - if ( pMed ) + if ( m_pViewImpl->GetParam() == 0 ) + { + m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) ); + m_pViewImpl->GetRequest()->Ignore(); + } + else { - const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot(); - long nFound = InsertMedium( nSlot, pMed, m_pViewImpl->GetParam() ); + m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) ); + m_pViewImpl->GetRequest()->Done(); + } + } + else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot ) + { + m_pViewImpl->GetRequest()->SetReturnValue( SfxInt32Item( nSlot, nFound ) ); - if ( SID_INSERTDOC == nSlot ) - { - if ( m_pViewImpl->GetParam() == 0 ) - { - m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) ); - m_pViewImpl->GetRequest()->Ignore(); - } - else - { - m_pViewImpl->GetRequest()->SetReturnValue( SfxBoolItem( nSlot, nFound != -1 ) ); - m_pViewImpl->GetRequest()->Done(); - } - } - else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot ) - { - m_pViewImpl->GetRequest()->SetReturnValue( SfxInt32Item( nSlot, nFound ) ); + if ( nFound > 0 ) // show Redline browser + { + SfxViewFrame* pVFrame = GetViewFrame(); + pVFrame->ShowChildWindow(FN_REDLINE_ACCEPT); - if ( nFound > 0 ) // show Redline browser - { - SfxViewFrame* pVFrame = GetViewFrame(); - pVFrame->ShowChildWindow(FN_REDLINE_ACCEPT); - - // re-initialize Redline dialog - sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); - SwRedlineAcceptChild* pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow( nId )); - if ( pRed ) - pRed->ReInitDlg( GetDocShell() ); - } - } + // re-initialize Redline dialog + sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); + SwRedlineAcceptChild* pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow( nId )); + if ( pRed ) + pRed->ReInitDlg( GetDocShell() ); } } - return 0; } void SwView::ExecuteScan( SfxRequest& rReq ) diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 8b2c4d39ec99..c8c9e0af2407 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -1360,32 +1360,31 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen } } -IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) +IMPL_LINK_TYPED( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void ) { Application::SetDefDialogParent( pDefParentWin ); - if ( ERRCODE_NONE == _pFileDlg->GetError() ) + if ( ERRCODE_NONE != _pFileDlg->GetError() ) + return; + + boost::scoped_ptr<SfxMediumList> pMedList(pDocInserter->CreateMediumList()); + if ( pMedList ) { - boost::scoped_ptr<SfxMediumList> pMedList(pDocInserter->CreateMediumList()); - if ( pMedList ) + Sequence< OUString >aFileNames( pMedList->size() ); + OUString* pFileNames = aFileNames.getArray(); + sal_Int32 nPos = 0; + for ( size_t i = 0, n = pMedList->size(); i < n; ++i ) { - Sequence< OUString >aFileNames( pMedList->size() ); - OUString* pFileNames = aFileNames.getArray(); - sal_Int32 nPos = 0; - for ( size_t i = 0, n = pMedList->size(); i < n; ++i ) - { - SfxMedium* pMed = pMedList->at( i ); - OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - sFileName += OUString(sfx2::cTokenSeparator); - sFileName += pMed->GetFilter()->GetFilterName(); - sFileName += OUString(sfx2::cTokenSeparator); - pFileNames[nPos++] = sFileName; - } - pMedList.reset(); - InsertRegion( pDocContent, aFileNames ); - DELETEZ( pDocContent ); + SfxMedium* pMed = pMedList->at( i ); + OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + sFileName += OUString(sfx2::cTokenSeparator); + sFileName += pMed->GetFilter()->GetFilterName(); + sFileName += OUString(sfx2::cTokenSeparator); + pFileNames[nPos++] = sFileName; } + pMedList.reset(); + InsertRegion( pDocContent, aFileNames ); + DELETEZ( pDocContent ); } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 3fdbaa24f141..54b332330c1e 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -908,14 +908,12 @@ IMPL_LINK_NOARG(SwNavigationPI, PopupModeEndHdl) return 1; } -IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow ) +IMPL_LINK_TYPED( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow, void ) { if ( pWindow == pFloatingWindow ) pFloatingWindow = 0; else pPopupWindow = 0; - - return 1; } void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/, |