summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-27 13:05:48 +0200
committerNoel Grandin <noel@peralex.com>2013-05-28 08:10:23 +0200
commitaff5c4d76b7a876e9ce9e0b70bb52864dd65be24 (patch)
tree5804f0a84475fbd4b4020b5bef54b6cae9fbf0c6 /framework
parent95ec16b513c979fd78d2f11d23157a4b8819d848 (diff)
fdo#46808, Use service constructor
Change-Id: Ia943f806ebce8afebabc76d1f74ad792ded761a9
Diffstat (limited to 'framework')
-rw-r--r--framework/source/classes/taskcreator.cxx4
-rw-r--r--framework/source/dispatch/dispatchinformationprovider.cxx3
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx6
-rw-r--r--framework/source/uielement/popupmenucontroller.cxx5
4 files changed, 7 insertions, 11 deletions
diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx
index 69f33bb9e216..bff649cf93b7 100644
--- a/framework/source/classes/taskcreator.cxx
+++ b/framework/source/classes/taskcreator.cxx
@@ -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 ;
diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx
index a40c746bd784..eb0e1288f28e 100644
--- a/framework/source/dispatch/dispatchinformationprovider.cxx
+++ b/framework/source/dispatch/dispatchinformationprovider.cxx
@@ -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;
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 6723b950cc72..7334c1ee0a75 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -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
{
diff --git a/framework/source/uielement/popupmenucontroller.cxx b/framework/source/uielement/popupmenucontroller.cxx
index 76e89490a7c8..d980f6e68cd2 100644
--- a/framework/source/uielement/popupmenucontroller.cxx
+++ b/framework/source/uielement/popupmenucontroller.cxx
@@ -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