diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-14 12:58:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-21 10:57:09 +0200 |
commit | bb121c864cc3c101ef733a4088c7ba3e36eced14 (patch) | |
tree | 2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /cui | |
parent | 6d818ed651aaafcfb12ebc21449d35947d2e85a9 (diff) |
fdo#46808, Convert frame::Desktop to new style service.
I had to drop XEventBroadcaster from the merged interface
because it introduced method name conflicts (addEventListener).
Shouldn't be an issue since it was scheduled to be dropped anyhow,
and the service implementation still implements it, so existing clients
will be fine.
I dropped the interface XPropertySet from the combined IDL because nobody
seems to be using it, and it's primary purpose appears to be to set weird
flags.
I dropped the optional interfaces
XStatusIndicatorFactory
XDispatchInformationProvider
from the combined IDL because the service does not implement them, and
nobody seems to be using them. I suspect they were mistakenly copied
from XFrame.
I also did not convert the Title, UserDefinedAttributes and LayoutManager
properties to attributes, again because no-one is using them.
Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 4 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 33 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 9 | ||||
-rw-r--r-- | cui/source/customize/eventdlg.cxx | 7 | ||||
-rw-r--r-- | cui/source/customize/selector.cxx | 9 | ||||
-rw-r--r-- | cui/source/dialogs/hlmarkwn.cxx | 92 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 8 | ||||
-rw-r--r-- | cui/source/inc/treeopt.hxx | 3 | ||||
-rw-r--r-- | cui/source/options/optupdt.cxx | 14 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 27 |
10 files changed, 81 insertions, 125 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index e261ad09a8d6..d9125aff8927 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -32,6 +32,7 @@ #include <svl/stritem.hxx> #include "svtools/treelistentry.hxx" #include <com/sun/star/embed/StorageFactory.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp> #include <sal/macros.h> @@ -77,7 +78,6 @@ using namespace com::sun::star; //----------------------------------------------- static ::rtl::OUString SERVICE_UICONFIGMGR (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager" )); -static ::rtl::OUString SERVICE_DESKTOP (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" )); static ::rtl::OUString MODULEPROP_SHORTNAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryShortName" )); static ::rtl::OUString MODULEPROP_UINAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryUIName" )); @@ -839,7 +839,7 @@ void SfxAcceleratorConfigPage::InitAccCfg() m_xFrame = GetFrame(); if ( !m_xFrame.is() ) { - css::uno::Reference< css::frame::XFramesSupplier > xDesktop(m_xSMGR->createInstance(SERVICE_DESKTOP), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( comphelper::getComponentContext(m_xSMGR) ); m_xFrame = xDesktop->getActiveFrame(); } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index aadccd82cb94..3b4e49f6f572 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -67,7 +67,7 @@ #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/UICommandDescription.hpp> #include <com/sun/star/ui/XUIConfiguration.hpp> #include <com/sun/star/ui/XUIConfigurationListener.hpp> @@ -760,15 +760,13 @@ SfxTabPage *CreateSvxEventConfigPage( Window *pParent, const SfxItemSet& rSet ) sal_Bool impl_showKeyConfigTabPage( const css::uno::Reference< css::frame::XFrame >& xFrame ) { - static ::rtl::OUString SERVICENAME_DESKTOP ("com.sun.star.frame.Desktop" ); static ::rtl::OUString MODULEID_STARTMODULE ("com.sun.star.frame.StartModule" ); try { - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::frame::XModuleManager2 > xMM (css::frame::ModuleManager::create(xContext)); + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext ); + css::uno::Reference< css::frame::XModuleManager2 > xMM = css::frame::ModuleManager::create(xContext); if (xFrame.is()) { @@ -1650,8 +1648,6 @@ void SvxConfigPage::Reset( const SfxItemSet& ) uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr; uno::Reference < css::ui::XUIConfigurationManager > xDocCfgMgr; - uno::Reference< lang::XMultiServiceFactory > xServiceManager( - ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext(), uno::UNO_QUERY_THROW ); @@ -1780,10 +1776,8 @@ void SvxConfigPage::Reset( const SfxItemSet& ) uno::Sequence< uno::Reference< frame::XFrame > > aFrameList; try { - uno::Reference< frame::XFramesSupplier > xFramesSupplier( - xServiceManager->createInstance( - OUString( "com.sun.star.frame.Desktop" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( + xContext ); uno::Reference< frame::XFrames > xFrames = xFramesSupplier->getFrames(); @@ -1876,20 +1870,17 @@ void SvxConfigPage::Reset( const SfxItemSet& ) ::rtl::OUString sModuleID; try { - uno::Reference< lang::XMultiServiceFactory > xServiceManager( - ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext( + ::comphelper::getProcessComponentContext() ); - uno::Reference< frame::XFramesSupplier > xFramesSupplier( - xServiceManager->createInstance( - OUString( "com.sun.star.frame.Desktop" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( + xContext ); if ( !_inout_rxFrame.is() ) - _inout_rxFrame = xFramesSupplier->getActiveFrame(); + _inout_rxFrame = xDesktop->getActiveFrame(); if ( !_inout_rxFrame.is() ) { - uno::Reference< frame::XDesktop > xDesktop( xFramesSupplier, uno::UNO_QUERY_THROW ); _inout_rxFrame = xDesktop->getCurrentFrame(); } @@ -1903,7 +1894,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) } uno::Reference< css::frame::XModuleManager2 > xModuleManager( - css::frame::ModuleManager::create( comphelper::getComponentContext(xServiceManager) ) ); + css::frame::ModuleManager::create( xContext ) ); try { diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 4043252a4967..3b0344c1a3f0 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp> #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp> #include <com/sun/star/frame/ModuleManager.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/document/XScriptInvocationContext.hpp> @@ -802,12 +802,7 @@ Reference< XInterface > SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName ) { Reference< XInterface > xModel; - Reference< lang::XMultiComponentFactory > mcf = - xCtx->getServiceManager(); - Reference< frame::XDesktop > desktop ( - mcf->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ), xCtx ), - UNO_QUERY ); + Reference< frame::XDesktop2 > desktop = frame::Desktop::create( xCtx ); Reference< container::XEnumerationAccess > componentsAccess = desktop->getComponents(); diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 8020deb3ecd6..fa994c25cad6 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -20,6 +20,7 @@ #include <svtools/svmedit.hxx> #include <tools/diagnose_ex.h> #include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XModuleManager.hpp> @@ -179,10 +180,8 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) { bool isReadonly = sal_False; - uno::Reference< frame::XFramesSupplier > xFramesSupplier( - ::comphelper::getProcessServiceFactory()->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ), - uno::UNO_QUERY ); + uno::Reference< frame::XDesktop2 > xFramesSupplier = frame::Desktop::create( + ::comphelper::getProcessComponentContext() ); uno::Reference< frame::XFrame > xFrame = xFramesSupplier->getActiveFrame(); diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index dfa8af78f897..658c81a822f4 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -44,7 +44,7 @@ #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp> #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp> #include <com/sun/star/frame/ModuleManager.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> @@ -591,12 +591,7 @@ SvxConfigGroupListBox::getDocumentModel( Reference< XComponentContext >& xCtx, OUString& docName ) { Reference< XInterface > xModel; - Reference< lang::XMultiComponentFactory > mcf = - xCtx->getServiceManager(); - Reference< frame::XDesktop > desktop ( - mcf->createInstanceWithContext( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")), xCtx ), - UNO_QUERY ); + Reference< frame::XDesktop2 > desktop = Desktop::create(xCtx); Reference< container::XEnumerationAccess > componentsAccess = desktop->getComponents(); diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 3ce1ba13ce7c..6430658f0b09 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -26,7 +26,7 @@ // UNO-Stuff #include <comphelper/processfactory.hxx> #include <com/sun/star/awt/XBitmap.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/document/XLinkTargetSupplier.hpp> @@ -244,66 +244,58 @@ sal_Bool SvxHlinkDlgMarkWnd::RefreshFromDoc( OUString aURL ) { mnError = LERR_NOERROR; - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - if( xFactory.is() ) + uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( ::comphelper::getProcessComponentContext() ); + uno::Reference< lang::XComponent > xComp; + + if( !aURL.isEmpty() ) { - uno::Reference< frame::XDesktop > xDesktop( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ), - uno::UNO_QUERY ); - if( xDesktop.is() ) + // load from url + uno::Reference< frame::XComponentLoader > xLoader( xDesktop, uno::UNO_QUERY ); + if( xLoader.is() ) { - uno::Reference< lang::XComponent > xComp; - - if( !aURL.isEmpty() ) - { - // load from url - uno::Reference< frame::XComponentLoader > xLoader( xDesktop, uno::UNO_QUERY ); - if( xLoader.is() ) - { - try - { - uno::Sequence< beans::PropertyValue > aArg(1); - aArg.getArray()[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" )); - aArg.getArray()[0].Value <<= (sal_Bool) sal_True; - xComp = xLoader->loadComponentFromURL( aURL, OUString(RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0, aArg ); - } - catch( const io::IOException& ) - { - - } - catch( const lang::IllegalArgumentException& ) - { - - } - } - } - else + try { - // the component with user focus ( current document ) - xComp = xDesktop->getCurrentComponent(); + uno::Sequence< beans::PropertyValue > aArg(1); + aArg.getArray()[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" )); + aArg.getArray()[0].Value <<= (sal_Bool) sal_True; + xComp = xLoader->loadComponentFromURL( aURL, OUString(RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0, aArg ); } - - if( xComp.is() ) + catch( const io::IOException& ) { - uno::Reference< document::XLinkTargetSupplier > xLTS( xComp, uno::UNO_QUERY ); - if( xLTS.is() ) - { - if( FillTree( xLTS->getLinks() ) == 0 ) - mnError = LERR_NOENTRIES; - } - else - mnError = LERR_DOCNOTOPEN; - - if ( !aURL.isEmpty() ) - xComp->dispose(); } - else + catch( const lang::IllegalArgumentException& ) { - if( !aURL.isEmpty() ) - mnError=LERR_DOCNOTOPEN; + } } } + else + { + // the component with user focus ( current document ) + xComp = xDesktop->getCurrentComponent(); + } + + if( xComp.is() ) + { + uno::Reference< document::XLinkTargetSupplier > xLTS( xComp, uno::UNO_QUERY ); + + if( xLTS.is() ) + { + if( FillTree( xLTS->getLinks() ) == 0 ) + mnError = LERR_NOENTRIES; + } + else + mnError = LERR_DOCNOTOPEN; + + if ( !aURL.isEmpty() ) + xComp->dispose(); + } + else + { + if( !aURL.isEmpty() ) + mnError=LERR_DOCNOTOPEN; + } return (mnError==0); } /************************************************************************* diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index c3ee4883e789..f4b1e9480cf1 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/script/provider/ScriptErrorRaisedException.hpp> #include <com/sun/star/script/provider/ScriptExceptionRaisedException.hpp> #include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/script/XInvocation.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> @@ -252,12 +253,7 @@ Reference< XInterface > SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName ) { Reference< XInterface > xModel; - Reference< lang::XMultiComponentFactory > mcf = - xCtx->getServiceManager(); - Reference< frame::XDesktop > desktop ( - mcf->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ), xCtx ), - UNO_QUERY ); + Reference< frame::XDesktop2 > desktop = frame::Desktop::create(xCtx); Reference< container::XEnumerationAccess > componentsAccess = desktop->getComponents(); diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx index ee6fa4069664..36a02501d356 100644 --- a/cui/source/inc/treeopt.hxx +++ b/cui/source/inc/treeopt.hxx @@ -129,7 +129,6 @@ struct LastPageSaver // class OfaTreeOptionsDialog -------------------------------------------- namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } } -namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } } namespace com { namespace sun { namespace star { namespace awt { class XContainerWindowProvider; } } } } struct OptionsPageInfo; @@ -179,8 +178,6 @@ private: void LoadExtensionOptions( const rtl::OUString& rExtensionId ); rtl::OUString GetModuleIdentifier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& xMFac, - const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame ); Module* LoadModule( const rtl::OUString& rModuleIdentifier ); VectorOfNodes LoadNodes( Module* pModule, const rtl::OUString& rExtensionId ); diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index c1539fccf9d2..10db1d46f87a 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/URLTransformer.hpp> @@ -324,13 +324,12 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl) IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl) { - uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference < uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); try { uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - com::sun::star::configuration::theDefaultProvider::get( - comphelper::getProcessComponentContext() ) ); + com::sun::star::configuration::theDefaultProvider::get( xContext ) ); beans::NamedValue aProperty; aProperty.Name = "nodepath"; @@ -347,14 +346,11 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl) util::URL aURL; xNameAccess->getByName("URL") >>= aURL.Complete; - uno::Reference < util::XURLTransformer > xTransformer( - util::URLTransformer::create( comphelper::getProcessComponentContext() ) ); + uno::Reference < util::XURLTransformer > xTransformer( util::URLTransformer::create( xContext ) ); xTransformer->parseStrict(aURL); - uno::Reference < frame::XDesktop > xDesktop( - xFactory->createInstance( "com.sun.star.frame.Desktop" ), - uno::UNO_QUERY_THROW ); + uno::Reference < frame::XDesktop2 > xDesktop = frame::Desktop::create( xContext ); uno::Reference< frame::XDispatchProvider > xDispatchProvider( xDesktop->getCurrentFrame(), uno::UNO_QUERY ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index df853efc0c43..30cffee230f2 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -55,7 +55,7 @@ #include <com/sun/star/awt/XContainerWindowProvider.hpp> #include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/loader/CannotActivateFactoryException.hpp> #include <com/sun/star/util/XMacroExpander.hpp> @@ -1490,13 +1490,11 @@ rtl::OUString getCurrentFactory_Impl( const Reference< XFrame >& _xFrame ) { rtl::OUString sIdentifier; Reference < XFrame > xCurrentFrame( _xFrame ); - Reference < XModuleManager2 > xModuleManager( ModuleManager::create(::comphelper::getProcessComponentContext()) ); + Reference < XModuleManager2 > xModuleManager = ModuleManager::create(::comphelper::getProcessComponentContext()); if ( !xCurrentFrame.is() ) { - Reference< XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - if ( xDesktop.is() ) - xCurrentFrame = xDesktop->getCurrentFrame(); + Reference< XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); + xCurrentFrame = xDesktop->getCurrentFrame(); } if ( xCurrentFrame.is() ) @@ -1599,7 +1597,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) rtl::OUString aFactory = getCurrentFactory_Impl( _xFrame ); - rtl::OUString sTemp = GetModuleIdentifier( comphelper::getProcessServiceFactory(), _xFrame ); + rtl::OUString sTemp = GetModuleIdentifier( _xFrame ); DBG_ASSERT( sTemp == aFactory, "S H I T!!!" ); // Writer and Writer/Web options @@ -1927,8 +1925,7 @@ void OfaTreeOptionsDialog::LoadExtensionOptions( const rtl::OUString& rExtension // when called by Tools - Options then load nodes of active module if ( rExtensionId.isEmpty() ) { - Reference< XMultiServiceFactory > xMSFac = comphelper::getProcessServiceFactory(); - pModule = LoadModule( GetModuleIdentifier( xMSFac, Reference< XFrame >() ) ); + pModule = LoadModule( GetModuleIdentifier( Reference< XFrame >() ) ); } VectorOfNodes aNodeList = LoadNodes( pModule, rExtensionId ); @@ -1937,19 +1934,17 @@ void OfaTreeOptionsDialog::LoadExtensionOptions( const rtl::OUString& rExtension delete pModule; } -rtl::OUString OfaTreeOptionsDialog::GetModuleIdentifier( - const Reference< XMultiServiceFactory >& xMFac, const Reference< XFrame >& rFrame ) +rtl::OUString OfaTreeOptionsDialog::GetModuleIdentifier( const Reference< XFrame >& rFrame ) { rtl::OUString sModule; Reference < XFrame > xCurrentFrame( rFrame ); - Reference < XModuleManager2 > xModuleManager( ModuleManager::create(comphelper::getComponentContext(xMFac)) ); + Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + Reference < XModuleManager2 > xModuleManager = ModuleManager::create(xContext); if ( !xCurrentFrame.is() ) { - Reference < XDesktop > xDesktop( xMFac->createInstance( - "com.sun.star.frame.Desktop" ), UNO_QUERY ); - if ( xDesktop.is() ) - xCurrentFrame = xDesktop->getCurrentFrame(); + Reference < XDesktop2 > xDesktop = Desktop::create( xContext ); + xCurrentFrame = xDesktop->getCurrentFrame(); } if ( xCurrentFrame.is() ) |