summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-04 14:56:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-05 14:56:19 +0200
commit1c7a54e3a14ad932e68b9281420e6c469e5dd2e5 (patch)
tree8d2d64a9536e738cc6cda4f0690993c98b658bdd /sfx2
parent55aa40bcd6ae3116c63a0eac18056bcfd011f43a (diff)
fdo#46808, Adapt frame::ModuleManager UNO service to new style
Create a merged XModuleManager2 interface for this service to implement. Which is backwards-compatible, but does not require creating a new service. Explicitly document the XNameReplace interface in the IDL, which is already implemented by the service, since there is code currently using it. Change-Id: Ib46349174b1ce495c240031e93c9427fc33d9853
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appserv.cxx4
-rw-r--r--sfx2/source/appl/imagemgr.cxx6
-rw-r--r--sfx2/source/appl/sfxhelp.cxx8
-rw-r--r--sfx2/source/dialog/dockwin.cxx6
-rw-r--r--sfx2/source/dialog/mailmodel.cxx10
-rw-r--r--sfx2/source/dialog/recfloat.cxx26
-rw-r--r--sfx2/source/dialog/taskpane.cxx9
-rw-r--r--sfx2/source/dialog/templdlg.cxx5
-rw-r--r--sfx2/source/doc/docfac.cxx5
-rw-r--r--sfx2/source/doc/doctemplates.cxx5
-rw-r--r--sfx2/source/doc/guisaveas.cxx10
-rw-r--r--sfx2/source/view/viewsh.cxx24
12 files changed, 48 insertions, 70 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index c99fe7abe552..4d9d216dc027 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -75,7 +75,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include "frmload.hxx"
@@ -935,7 +935,7 @@ namespace
Reference < XFramesSupplier > xSupplier( i_rContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW );
- Reference< XModuleManager > xCheck( i_rContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+ Reference< XModuleManager > xCheck( ModuleManager::create(i_rContext.getUNOContext()), UNO_QUERY_THROW );
sal_Int32 nCount = xContainer->getCount();
for ( sal_Int32 i=0; i<nCount; ++i )
diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index 216e81bf829e..032e6355bd13 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -20,7 +20,7 @@
#include "sfx2/imagemgr.hxx"
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/ui/XImageManager.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/ImageType.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
@@ -149,9 +149,7 @@ Image SAL_CALL GetImage(
if ( !xModuleManager.is() )
{
xModuleManager = Reference< XModuleManager >(
- ::comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.ModuleManager" ))),
+ ModuleManager::create(::comphelper::getProcessComponentContext()),
UNO_QUERY );
m_xModuleManager = xModuleManager;
}
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 8f728c55349e..217538300969 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <toolkit/helper/vclunohelper.hxx>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <unotools/configmgr.hxx>
@@ -415,8 +415,7 @@ SfxHelp::~SfxHelp()
{
::rtl::OUString sIdentifier;
Reference < XFrame > xCurrentFrame;
- Reference < XModuleManager > xModuleManager( ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY );
+ Reference < XModuleManager > xModuleManager( ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY );
Reference < XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
if ( xDesktop.is() )
@@ -452,8 +451,7 @@ String SfxHelp::GetHelpModuleName_Impl()
try
{
Reference < XModuleManager > xModuleManager(
- ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY );
+ ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY );
Sequence< PropertyValue > lProps;
Reference< ::com::sun::star::container::XNameAccess > xCont( xModuleManager, UNO_QUERY);
if ( xCont.is() )
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 6d77417dfd14..1bcf9866fba3 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -25,6 +25,7 @@
#include <vcl/timer.hxx>
#include <rtl/instance.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/dockwin.hxx>
@@ -43,7 +44,7 @@
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#define MAX_TOGGLEAREA_WIDTH 20
@@ -181,8 +182,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
if ( !xModuleManager.is() )
{
xModuleManager = uno::Reference< frame::XModuleManager >(
- xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))),
+ frame::ModuleManager::create(comphelper::ComponentContext(xServiceManager).getUNOContext()),
uno::UNO_QUERY );
m_xModuleManager = xModuleManager;
}
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index b66cf8fa6578..9465fa0a4d6a 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -33,7 +33,7 @@
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/security/CertificateValidity.hpp>
@@ -303,13 +303,11 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
bool bSendAsPDF = (rType.equalsAsciiL( PDF_DOCUMENT_TYPE, PDF_DOCUMENT_TYPE_LEN ));
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- if (!xSMGR.is())
+ css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ if (!xContext.is())
return eRet;
- const rtl::OUString aModuleManager( "com.sun.star.frame.ModuleManager" );
- css::uno::Reference< css::frame::XModuleManager > xModuleManager( xSMGR->createInstance( aModuleManager ), css::uno::UNO_QUERY_THROW );
- if ( !xModuleManager.is() )
- return eRet;
+ css::uno::Reference< css::frame::XModuleManager > xModuleManager( css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW );
rtl::OUString aModule;
try
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index a43b9fba17db..fb30ecc42f1b 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -18,7 +18,7 @@
*/
#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/UICommandDescription.hpp>
@@ -26,7 +26,6 @@
#include <svl/eitem.hxx>
#include <svtools/generictoolboxcontroller.hxx>
#include <vcl/msgbox.hxx>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include "recfloat.hxx"
@@ -46,37 +45,32 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c
rtl::OUString aLabel;
rtl::OUString aModuleIdentifier;
uno::Reference< container::XNameAccess > xUICommandLabels;
- uno::Reference< lang::XMultiServiceFactory > xServiceManager;
+ uno::Reference< uno::XComponentContext > xContext;
uno::Reference< container::XNameAccess > xUICommandDescription;
uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager;
- static uno::WeakReference< lang::XMultiServiceFactory > xTmpServiceManager;
- static uno::WeakReference< container::XNameAccess > xTmpNameAccess;
+ static uno::WeakReference< uno::XComponentContext > xTmpContext;
+ static uno::WeakReference< container::XNameAccess > xTmpNameAccess;
static uno::WeakReference< ::com::sun::star::frame::XModuleManager > xTmpModuleMgr;
- xServiceManager = xTmpServiceManager;
- if ( !xServiceManager.is() )
+ xContext = xTmpContext;
+ if ( !xContext.is() )
{
- xServiceManager = ::comphelper::getProcessServiceFactory();
- xTmpServiceManager = xServiceManager;
+ xContext = ::comphelper::getProcessComponentContext();
+ xTmpContext = xContext;
}
xUICommandDescription = xTmpNameAccess;
if ( !xUICommandDescription.is() )
{
- xUICommandDescription = uno::Reference< container::XNameAccess >(
- ui::UICommandDescription::create(comphelper::ComponentContext(xServiceManager).getUNOContext()) );
+ xUICommandDescription = uno::Reference< container::XNameAccess >( ui::UICommandDescription::create(xContext) );
xTmpNameAccess = xUICommandDescription;
}
xModuleManager = xTmpModuleMgr;
if ( !xModuleManager.is() )
{
- xModuleManager = uno::Reference< ::com::sun::star::frame::XModuleManager >(
- xServiceManager->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.ModuleManager" ))),
- uno::UNO_QUERY_THROW );
+ xModuleManager = uno::Reference< frame::XModuleManager >( frame::ModuleManager::create(xContext), uno::UNO_QUERY_THROW );
xTmpModuleMgr = xModuleManager;
}
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index a33e5a47201b..2f8e90476c3c 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -27,7 +27,7 @@
#include "sfxlocal.hrc"
#include "helpid.hrc"
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/ui/XToolPanel.hpp>
#include <com/sun/star/ui/XUIElementFactory.hpp>
@@ -71,6 +71,7 @@ namespace sfx2
using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::ModuleManager;
using ::com::sun::star::frame::XModuleManager;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::ui::XToolPanel;
@@ -100,7 +101,7 @@ namespace sfx2
::rtl::OUStringBuffer aPathComposer;
try
{
- const Reference< XNameAccess > xModuleAccess( aContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+ const Reference< XNameAccess > xModuleAccess( ModuleManager::create(aContext.getUNOContext()), UNO_QUERY_THROW );
const ::comphelper::NamedValueCollection aModuleProps( xModuleAccess->getByName( i_rModuleIdentifier ) );
const ::rtl::OUString sWindowStateRef( aModuleProps.getOrDefault( "ooSetupFactoryWindowStateConfigRef", ::rtl::OUString() ) );
@@ -127,8 +128,8 @@ namespace sfx2
::rtl::OUString sModuleName;
try
{
- const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- const Reference< XModuleManager > xModuleManager( aContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+ const Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ const Reference< XModuleManager > xModuleManager( ModuleManager::create(xContext), UNO_QUERY_THROW );
sModuleName = xModuleManager->identify( i_rDocumentFrame );
}
catch( const Exception& )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 307bcb464071..64a242cfbee8 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/ui/UICommandDescription.hpp>
#include "sfx2/sfxhelp.hxx"
@@ -745,8 +745,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
pStyleSheetPool ( NULL ),
pTreeBox ( NULL ),
pCurObjShell ( NULL ),
- xModuleManager ( ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ),
+ xModuleManager ( frame::ModuleManager::create(::comphelper::getProcessComponentContext()), UNO_QUERY ),
m_pDeletionWatcher ( NULL ),
aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH ),
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;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e33d59c168d4..8ea9415164c3 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -26,7 +26,7 @@
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/EmbedMisc.hpp>
@@ -232,15 +232,15 @@ static ::rtl::OUString RetrieveLabelFromCommand(
css::uno::Reference< css::container::XNameAccess > xNameAccess( s_xNameAccess );
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR(
::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::uno::XComponentContext > xContext(
+ ::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW);
try
{
if ( !xModuleManager.is() )
{
xModuleManager = css::uno::Reference< css::frame::XModuleManager >(
- xSMGR->createInstance(
- ::rtl::OUString( "com.sun.star.frame.ModuleManager" )),
- css::uno::UNO_QUERY_THROW );
+ css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW);
s_xModuleManager = xModuleManager;
}
@@ -362,12 +362,11 @@ enum ETypeFamily
::rtl::OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame ,
ETypeFamily eTypeFamily)
{
- static ::rtl::OUString SERVICENAME_MODULEMANAGER("com.sun.star.frame.ModuleManager");
-
try
{
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR (::comphelper::getProcessServiceFactory() , css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::frame::XModuleManager > xModuleManager(xSMGR->createInstance(SERVICENAME_MODULEMANAGER), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::uno::XComponentContext > xContext (::comphelper::getProcessComponentContext() , css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::frame::XModuleManager > xModuleManager(css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW);
::rtl::OUString sModule = xModuleManager->identify(xFrame);
::rtl::OUString sType ;
@@ -625,16 +624,11 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
const sal_Int32 FILTERFLAG_EXPORT = 0x00000002;
css::uno::Reference< lang::XMultiServiceFactory > xSMGR(::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW);
- css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
+ css::uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
css::uno::Reference< css::frame::XModel > xModel;
- const rtl::OUString aModuleManager( "com.sun.star.frame.ModuleManager" );
- css::uno::Reference< css::frame::XModuleManager > xModuleManager( xSMGR->createInstance( aModuleManager ), css::uno::UNO_QUERY_THROW );
- if ( !xModuleManager.is() )
- {
- rReq.Done(sal_False);
- return;
- }
+ css::uno::Reference< css::frame::XModuleManager > xModuleManager( css::frame::ModuleManager::create(xContext), css::uno::UNO_QUERY_THROW );
rtl::OUString aModule;
try