From b731d71c67b864b61f5c08e219140be59c473f53 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 18 Apr 2014 17:25:30 +0200 Subject: sfx2: Move InitInterface_Impl() method out of SFX_IMPL_INTERFACE. SFX_IMPL_INTERFACE previously looked like a function; where in fact it is several methods defined at once, and only the last one has a body. This is extremely confusing and hard to read; let's kill that nonsense. Change-Id: Ia4ae22eb58b1260c9c827c894f5345693bad49e7 --- sfx2/source/appl/appmisc.cxx | 10 ++++------ sfx2/source/appl/module.cxx | 8 ++------ sfx2/source/doc/objserv.cxx | 8 ++------ sfx2/source/view/viewfrm.cxx | 5 ++--- sfx2/source/view/viewsh.cxx | 5 ++--- 5 files changed, 12 insertions(+), 24 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 76a120885cca..a301d0ba29dc 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -91,6 +91,8 @@ using namespace ::com::sun::star::container; #define SFX_ITEMTYPE_STATBAR 4 SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) + +void SfxApplication::InitInterface_Impl() { GetStaticInterface()->RegisterStatusBar(SfxResId(SFX_ITEMTYPE_STATBAR)); @@ -106,11 +108,7 @@ SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) GetStaticInterface()->RegisterChildWindow(SID_DOCKWIN_9); } -SfxProgress* SfxApplication::GetProgress() const - -/* [Description] - - Returns the running SfxProgress for the entire application or 0 if +/** Returns the running SfxProgress for the entire application or 0 if none is running for the entire application. [Cross-reference] @@ -118,7 +116,7 @@ SfxProgress* SfxApplication::GetProgress() const */ - +SfxProgress* SfxApplication::GetProgress() const { return pAppData_Impl->pProgress; } diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 1eefa3f9f6a1..32508b602dca 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -99,21 +99,17 @@ ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, bool bBig ) TYPEINIT1(SfxModule, SfxShell); +SFX_IMPL_INTERFACE(SfxModule, SfxShell, SfxResId(0)) - -SFX_IMPL_INTERFACE(SfxModule,SfxShell,SfxResId(0)) +void SfxModule::InitInterface_Impl() { } - - ResMgr* SfxModule::GetResMgr() { return pResMgr; } - - SfxModule::SfxModule( ResMgr* pMgrP, bool bDummyP, SfxObjectFactory* pFactoryP, ... ) : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 87dc8ebcfbb7..9dc181c89eac 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -113,16 +113,12 @@ using namespace ::com::sun::star::task; #define SfxObjectShell #include "sfxslots.hxx" +SFX_IMPL_INTERFACE(SfxObjectShell, SfxShell, SfxResId(0)) - - - -SFX_IMPL_INTERFACE(SfxObjectShell,SfxShell,SfxResId(0)) +void SfxObjectShell::InitInterface_Impl() { } - - class SfxClosePreventer_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XCloseListener > { bool m_bGotOwnership; diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 10f63b651f1e..2fdf5a6c8829 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -143,9 +143,9 @@ using ::com::sun::star::container::XIndexContainer; #include "sfxslots.hxx" #undef SfxViewFrame - - SFX_IMPL_INTERFACE(SfxViewFrame,SfxShell,SfxResId(0)) + +void SfxViewFrame::InitInterface_Impl() { GetStaticInterface()->RegisterChildWindow(SID_BROWSER); GetStaticInterface()->RegisterChildWindow(SID_RECORDING_FLOATWINDOW); @@ -158,7 +158,6 @@ SFX_IMPL_INTERFACE(SfxViewFrame,SfxShell,SfxResId(0)) TYPEINIT2(SfxViewFrame,SfxShell,SfxListener); TYPEINIT1(SfxViewFrameItem, SfxPoolItem); - namespace { bool moduleHasToolPanels( SfxViewFrame_Impl& i_rViewFrameImpl ) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index f204d345c875..69ef3af1c123 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -289,17 +289,16 @@ SfxViewShell_Impl::SfxViewShell_Impl(sal_uInt16 const nFlags) , m_pAccExec(0) {} - SFX_IMPL_INTERFACE(SfxViewShell,SfxShell,SfxResId(0)) + +void SfxViewShell::InitInterface_Impl() { } TYPEINIT2(SfxViewShell,SfxShell,SfxListener); - /** search for a filter name dependent on type and module */ - static OUString impl_retrieveFilterNameFromTypeAndModule( const css::uno::Reference< css::container::XContainerQuery >& rContainerQuery, const OUString& rType, -- cgit