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 /framework/source/uielement/buttontoolbarcontroller.cxx | |
parent | 34da7fbcc643ad209290c6da456dbfb17aeb9ac0 (diff) |
fdo#46808, Convert svt::ToolboxController to XComponentContext
.. and all of it's friends
Change-Id: I408d9308d1d1a4f8ed0055ac5f4042d729c44d1e
Diffstat (limited to 'framework/source/uielement/buttontoolbarcontroller.cxx')
-rw-r--r-- | framework/source/uielement/buttontoolbarcontroller.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index 6c1c8c145b33..cd827d7eebcb 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include "com/sun/star/util/XMacroExpander.hpp" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/beans/XPropertySet.hpp" @@ -55,14 +56,14 @@ namespace framework { ButtonToolbarController::ButtonToolbarController( - const uno::Reference< lang::XMultiServiceFactory >& rServiceManager, + const uno::Reference< uno::XComponentContext >& rxContext, ToolBox* pToolBar, const OUString& aCommand ) : cppu::OWeakObject(), m_bInitialized( sal_False ), m_bDisposed( sal_False ), m_aCommandURL( aCommand ), - m_xServiceManager( rServiceManager ), + m_xContext( rxContext ), m_pToolbar( pToolBar ) { } @@ -130,7 +131,10 @@ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException else if ( aPropValue.Name == "CommandURL" ) aPropValue.Value >>= m_aCommandURL; else if ( aPropValue.Name == "ServiceManager" ) - m_xServiceManager.set(aPropValue.Value,UNO_QUERY); + { + Reference<XMultiServiceFactory> xServiceManager(aPropValue.Value,UNO_QUERY); + m_xContext = comphelper::getComponentContext(xServiceManager); + } } } } @@ -146,7 +150,7 @@ void SAL_CALL ButtonToolbarController::dispose() throw (::com::sun::star::uno::R if ( m_bDisposed ) throw DisposedException(); - m_xServiceManager.clear(); + m_xContext.clear(); m_xURLTransformer.clear(); m_xFrame.clear(); m_pToolbar = 0; @@ -220,12 +224,12 @@ throw (::com::sun::star::uno::RuntimeException) if ( m_bInitialized && m_xFrame.is() && - m_xServiceManager.is() && + m_xContext.is() && !m_aCommandURL.isEmpty() ) { if ( !m_xURLTransformer.is() ) { - m_xURLTransformer = util::URLTransformer::create( ::comphelper::getComponentContext(m_xServiceManager) ); + m_xURLTransformer = util::URLTransformer::create( m_xContext ); } xFrame = m_xFrame; |