Kaydet (Commit) aff5c4d7 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Use service constructor

Change-Id: Ia943f806ebce8afebabc76d1f74ad792ded761a9
üst 95ec16b5
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <services.h> #include <services.h>
#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/TaskCreator.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/NamedValue.hpp>
...@@ -96,8 +97,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin ...@@ -96,8 +97,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin
// BTW: The used fallback creator service (IMPLEMENTATIONNAME_FWK_TASKCREATOR) is implemented in the same // BTW: The used fallback creator service (IMPLEMENTATIONNAME_FWK_TASKCREATOR) is implemented in the same
// library then these class here ... Why we should not be able to create it ? // library then these class here ... Why we should not be able to create it ?
if ( ! xCreator.is()) if ( ! xCreator.is())
xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >( xCreator = css::frame::TaskCreator::create(xContext);
xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_FWK_TASKCREATOR, xContext), css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::uno::Any > lArgs(5); css::uno::Sequence< css::uno::Any > lArgs(5);
css::beans::NamedValue aArg ; css::beans::NamedValue aArg ;
......
...@@ -149,8 +149,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvide ...@@ -149,8 +149,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvide
css::uno::Reference< css::frame::XDispatchInformationProvider > xCloseDispatch(xCloser , css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xCloseDispatch(xCloser , css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xController (xFrame->getController() , css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xController (xFrame->getController() , css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher( css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(
css::uno::Reference<css::lang::XMultiServiceFactory>(xContext->getServiceManager(), css::uno::UNO_QUERY_THROW) xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER, xContext), css::uno::UNO_QUERY);
->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY);
css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3); css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3);
lProvider[0] = xController ; lProvider[0] = xController ;
lProvider[1] = xCloseDispatch; lProvider[1] = xCloseDispatch;
......
...@@ -291,8 +291,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue ...@@ -291,8 +291,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
aPropValue.Value <<= m_xFrame; aPropValue.Value <<= m_xFrame;
aArgs[1] <<= aPropValue; aArgs[1] <<= aPropValue;
aPropValue.Name = OUString( "ServiceManager" ); aPropValue.Name = OUString( "ServiceManager" );
Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW); aPropValue.Value <<= Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aPropValue.Value <<= xMSF;
aArgs[2] <<= aPropValue; aArgs[2] <<= aPropValue;
aPropValue.Name = OUString( "ParentWindow" ); aPropValue.Name = OUString( "ParentWindow" );
aPropValue.Value <<= xToolbarWindow; aPropValue.Value <<= xToolbarWindow;
...@@ -335,8 +334,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue ...@@ -335,8 +334,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
aPropValue.Value <<= aURL; aPropValue.Value <<= aURL;
aArgs[1] <<= aPropValue; aArgs[1] <<= aPropValue;
aPropValue.Name = OUString( "ServiceManager" ); aPropValue.Name = OUString( "ServiceManager" );
Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW); aPropValue.Value <<= Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aPropValue.Value <<= xMSF;
aArgs[2] <<= aPropValue; aArgs[2] <<= aPropValue;
try try
{ {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include <com/sun/star/awt/XPopupMenu.hpp> #include <com/sun/star/awt/PopupMenu.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp> #include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp> #include <com/sun/star/frame/XPopupMenuController.hpp>
...@@ -201,8 +201,7 @@ Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() thro ...@@ -201,8 +201,7 @@ Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() thro
if( !mxPopupMenu.is() ) if( !mxPopupMenu.is() )
{ {
mxPopupMenu = Reference< awt::XPopupMenu >( mxPopupMenu = awt::PopupMenu::create(m_xContext);
m_xContext->getServiceManager()->createInstanceWithContext("stardiv.Toolkit.VCLXPopupMenu", m_xContext), UNO_QUERY_THROW );
mxPopupMenuController->setPopupMenu( mxPopupMenu ); mxPopupMenuController->setPopupMenu( mxPopupMenu );
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment