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 @@
#include <services.h>
#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/beans/NamedValue.hpp>
......@@ -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
// library then these class here ... Why we should not be able to create it ?
if ( ! xCreator.is())
xCreator = css::uno::Reference< css::lang::XSingleServiceFactory >(
xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_FWK_TASKCREATOR, xContext), css::uno::UNO_QUERY_THROW);
xCreator = css::frame::TaskCreator::create(xContext);
css::uno::Sequence< css::uno::Any > lArgs(5);
css::beans::NamedValue aArg ;
......
......@@ -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 > xController (xFrame->getController() , css::uno::UNO_QUERY);
css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher(
css::uno::Reference<css::lang::XMultiServiceFactory>(xContext->getServiceManager(), css::uno::UNO_QUERY_THROW)
->createInstance(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER), css::uno::UNO_QUERY);
xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_APPDISPATCHPROVIDER, xContext), css::uno::UNO_QUERY);
css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > lProvider(3);
lProvider[0] = xController ;
lProvider[1] = xCloseDispatch;
......
......@@ -291,8 +291,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
aPropValue.Value <<= m_xFrame;
aArgs[1] <<= aPropValue;
aPropValue.Name = OUString( "ServiceManager" );
Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aPropValue.Value <<= xMSF;
aPropValue.Value <<= Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aArgs[2] <<= aPropValue;
aPropValue.Name = OUString( "ParentWindow" );
aPropValue.Value <<= xToolbarWindow;
......@@ -335,8 +334,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
aPropValue.Value <<= aURL;
aArgs[1] <<= aPropValue;
aPropValue.Name = OUString( "ServiceManager" );
Reference<XMultiServiceFactory> xMSF(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aPropValue.Value <<= xMSF;
aPropValue.Value <<= Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW);
aArgs[2] <<= aPropValue;
try
{
......
......@@ -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/XPopupMenuController.hpp>
......@@ -201,8 +201,7 @@ Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() thro
if( !mxPopupMenu.is() )
{
mxPopupMenu = Reference< awt::XPopupMenu >(
m_xContext->getServiceManager()->createInstanceWithContext("stardiv.Toolkit.VCLXPopupMenu", m_xContext), UNO_QUERY_THROW );
mxPopupMenu = awt::PopupMenu::create(m_xContext);
mxPopupMenuController->setPopupMenu( mxPopupMenu );
}
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