summaryrefslogtreecommitdiff
path: root/cui/source/options/treeopt.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-14 12:58:00 +0200
committerNoel Grandin <noel@peralex.com>2012-12-21 10:57:09 +0200
commitbb121c864cc3c101ef733a4088c7ba3e36eced14 (patch)
tree2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /cui/source/options/treeopt.cxx
parent6d818ed651aaafcfb12ebc21449d35947d2e85a9 (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/source/options/treeopt.cxx')
-rw-r--r--cui/source/options/treeopt.cxx27
1 files changed, 11 insertions, 16 deletions
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() )