diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-20 09:29:30 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-08 13:53:03 +0200 |
commit | 86fdce60115014ddfae05993ef43686c9dbd6004 (patch) | |
tree | d50705d5f93fec079e4d676cd2a5a9c50783c6f3 /sfx2 | |
parent | 34da7fbcc643ad209290c6da456dbfb17aeb9ac0 (diff) |
fdo#46808, Convert svt::ToolboxController to XComponentContext
.. and all of it's friends
Change-Id: I408d9308d1d1a4f8ed0055ac5f4042d729c44d1e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/recfloat.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inet/inettbc.cxx | 19 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 7 |
3 files changed, 12 insertions, 16 deletions
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 27cb93c50cea..ad081894866a 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -182,7 +182,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl( // create a generic toolbox controller for our internal toolbox svt::GenericToolboxController* pController = new svt::GenericToolboxController( - ::comphelper::getProcessServiceFactory(), + ::comphelper::getProcessComponentContext(), xFrame, &aTbx, SID_STOP_RECORDING, diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index b882ff0b8dd8..cb9145699994 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -101,7 +101,7 @@ void SfxURLToolBoxControl_Impl::OpenURL( const String& rName, sal_Bool /*bNew*/ return; Reference< XDispatchProvider > xDispatchProvider( getFrameInterface(), UNO_QUERY ); - if ( xDispatchProvider.is() && m_xServiceManager.is() ) + if ( xDispatchProvider.is() ) { URL aTargetURL; OUString aTarget( OUString("_default")); @@ -181,18 +181,15 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl) SvtURLBox* pURLBox = GetURLBox(); OpenURL( pURLBox->GetURL(), pURLBox->IsCtrlOpen() ); - if ( m_xServiceManager.is() ) + Reference< XDesktop2 > xDesktop = Desktop::create( m_xContext ); + Reference< XFrame > xFrame( xDesktop->getActiveFrame(), UNO_QUERY ); + if ( xFrame.is() ) { - Reference< XDesktop2 > xDesktop = Desktop::create( comphelper::getComponentContext(m_xServiceManager) ); - Reference< XFrame > xFrame( xDesktop->getActiveFrame(), UNO_QUERY ); - if ( xFrame.is() ) + Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); + if ( pWin ) { - Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - if ( pWin ) - { - pWin->GrabFocus(); - pWin->ToTop( TOTOP_RESTOREWHENMIN ); - } + pWin->GrabFocus(); + pWin->ToTop( TOTOP_RESTOREWHENMIN ); } } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 8ed58cab5eba..a9e786f30644 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -783,7 +783,6 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBar return; // create element with factory - Reference< XMultiServiceFactory > xServiceManager = getServiceManager(); Reference< XFrame > xFrame = getFrameInterface(); Reference< XUIElement > xUIElement; Reference< XUIElementFactoryManager > xUIElementFactory; @@ -791,7 +790,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const OUString& rSubToolBar xUIElementFactory = xWeakUIElementFactory; if ( !xUIElementFactory.is() ) { - xUIElementFactory = UIElementFactoryManager::create( comphelper::getComponentContext(xServiceManager) ); + xUIElementFactory = UIElementFactoryManager::create( m_xContext ); xWeakUIElementFactory = xUIElementFactory; } @@ -1484,7 +1483,7 @@ SfxPopupWindow* SfxAppToolBoxControl_Impl::CreatePopupWindow() if ( !pMenu ) { - ::framework::MenuConfiguration aConf( comphelper::getComponentContext(m_xServiceManager) ); + ::framework::MenuConfiguration aConf( m_xContext ); if ( m_aCommandURL == ".uno:AddDirect" ) pMenu = aConf.CreateBookmarkMenu( m_xFrame, BOOKMARK_NEWMENU ); else @@ -1551,7 +1550,7 @@ void SfxAppToolBoxControl_Impl::StateChanged // to check for supported URLs ... if ( !pMenu ) { - ::framework::MenuConfiguration aConf( comphelper::getComponentContext(m_xServiceManager) ); + ::framework::MenuConfiguration aConf( m_xContext ); // This toolbox controller is used for two popup menus (new documents and wizards!). Create the correct // popup menu according to the slot ID our controller has been initialized with. if ( nSlotId == SID_NEWDOCDIRECT ) |