summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/docfac.cxx5
-rw-r--r--sfx2/source/doc/doctemplates.cxx5
-rw-r--r--sfx2/source/doc/guisaveas.cxx10
3 files changed, 8 insertions, 12 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 7ae8930a474e..135ef0bc7920 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <comphelper/processfactory.hxx>
@@ -383,10 +384,10 @@ String SfxObjectFactory::GetModuleName() const
{
try
{
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+ css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::container::XNameAccess > xModuleManager(
- xSMGR->createInstance("com.sun.star.frame.ModuleManager"),
+ css::frame::ModuleManager::create(xContext),
css::uno::UNO_QUERY_THROW);
::rtl::OUString sDocService(GetDocumentServiceName());
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 0e8ca95d142a..1ea6af05ced6 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -50,7 +50,7 @@
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/uno/Exception.hpp>
#include <svtools/templatefoldercache.hxx>
@@ -1845,8 +1845,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
// get document service name
uno::Reference< frame::XModuleManager > xModuleManager(
- xFactory->createInstance(
- ::rtl::OUString("com.sun.star.frame.ModuleManager") ),
+ frame::ModuleManager::create(comphelper::ComponentContext(xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) );
if ( sDocServiceName.isEmpty() )
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 78a12cf716dc..3af0dd378252 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/XStorable2.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -45,7 +46,6 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/io/IOException.hpp>
#include "guisaveas.hxx"
@@ -1280,12 +1280,8 @@ uno::Reference< ::com::sun::star::frame::XModuleManager > SfxStoringHelper::GetM
if ( !m_xModuleManager.is() )
{
m_xModuleManager = uno::Reference< ::com::sun::star::frame::XModuleManager >(
- GetServiceFactory()->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ),
- uno::UNO_QUERY );
-
- if ( !m_xModuleManager.is() )
- throw uno::RuntimeException();
+ frame::ModuleManager::create(comphelper::ComponentContext(GetServiceFactory()).getUNOContext()),
+ uno::UNO_QUERY_THROW );
}
return m_xModuleManager;