summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-11 08:16:08 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:58 +0200
commitc1e42d60c572d23c61a703cd66495eab1cea4e05 (patch)
tree431e056f9e19802e87df477996a298771bafa237 /framework
parent9779ae8bdeffe1c296803dffefa0d69b0fb8f975 (diff)
fdo#46808, use service constructor for ui::WindowStateConfiguration
Change-Id: I0b7f773a7db47049d7df4138d07e7fc38c657a65
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx4
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx2
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx50
4 files changed, 26 insertions, 31 deletions
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 7ad58c5bfac9..fcae2a074a7b 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -61,7 +61,6 @@ namespace framework{
#define SERVICENAME_UICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.UIConfigurationManager" )
#define SERVICENAME_MODULEUICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManager" )
#define SERVICENAME_MENUBARFACTORY DECLARE_ASCII("com.sun.star.ui.UIElementFactory" )
-#define SERVICENAME_WINDOWSTATECONFIGURATION DECLARE_ASCII("com.sun.star.ui.WindowStateConfiguration" )
#define SERVICENAME_STARTMODULE DECLARE_ASCII("com.sun.star.frame.StartModule" )
#define SERVICENAME_FRAMECONTROLLER DECLARE_ASCII("com.sun.star.frame.Controller" )
#define SERVICENAME_MODULEACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.ModuleAcceleratorConfiguration")
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 1c20dd3faebe..18f1f81ec386 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -50,6 +50,7 @@
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/ui/WindowStateConfiguration.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
@@ -132,8 +133,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, m_xModuleManager( ModuleManager::create( comphelper::getComponentContext(xServiceManager) ))
, m_xUIElementFactoryManager( Reference< ui::XUIElementFactory >(
xServiceManager->createInstance( SERVICENAME_UIELEMENTFACTORYMANAGER ), UNO_QUERY ))
- , m_xPersistentWindowStateSupplier( Reference< XNameAccess >(
- xServiceManager->createInstance( SERVICENAME_WINDOWSTATECONFIGURATION ), UNO_QUERY ))
+ , m_xPersistentWindowStateSupplier( ui::WindowStateConfiguration::create( comphelper::getComponentContext(xServiceManager) ) )
, m_pGlobalSettings( 0 )
, m_aStatusBarAlias( "private:resource/statusbar/statusbar" )
, m_aProgressBarAlias( "private:resource/progressbar/progressbar" )
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index a6989d2d29f1..8ed6853c4110 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -1345,7 +1345,7 @@ DEFINE_XTYPEPROVIDER_4 ( WindowStateConfiguration
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( WindowStateConfiguration ,
::cppu::OWeakObject ,
- SERVICENAME_WINDOWSTATECONFIGURATION ,
+ DECLARE_ASCII("com.sun.star.ui.WindowStateConfiguration"),
IMPLEMENTATIONNAME_WINDOWSTATECONFIGURATION
)
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 34520aa830ec..75b8351ff620 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
+#include <com/sun/star/ui/WindowStateConfiguration.hpp>
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
@@ -824,38 +825,33 @@ void SAL_CALL ToolbarsMenuController::initialize( const Sequence< Any >& aArgume
if ( m_bInitialized )
{
Reference< XModuleManager2 > xModuleManager = ModuleManager::create( comphelper::getComponentContext(m_xServiceManager) );
- Reference< XNameAccess > xPersistentWindowStateSupplier( m_xServiceManager->createInstance(
- SERVICENAME_WINDOWSTATECONFIGURATION ),
- UNO_QUERY );
+ Reference< XNameAccess > xPersistentWindowStateSupplier = ::com::sun::star::ui::WindowStateConfiguration::create( comphelper::getComponentContext(m_xServiceManager) );
// Retrieve persistent window state reference for our module
- if ( xPersistentWindowStateSupplier.is() && xModuleManager.is() )
+ rtl::OUString aModuleIdentifier;
+ try
{
- rtl::OUString aModuleIdentifier;
- try
- {
- aModuleIdentifier = xModuleManager->identify( m_xFrame );
- xPersistentWindowStateSupplier->getByName( aModuleIdentifier ) >>= m_xPersistentWindowState;
-
- Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier =
- ModuleUIConfigurationManagerSupplier::create( comphelper::getComponentContext(m_xServiceManager) );
- m_xModuleCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
-
- Reference< XController > xController = m_xFrame->getController();
- Reference< XModel > xModel;
- if ( xController.is() )
- xModel = xController->getModel();
- if ( xModel.is() )
- {
- Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
- if ( xUIConfigurationManagerSupplier.is() )
- m_xDocCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
- }
- m_aModuleIdentifier = aModuleIdentifier;
- }
- catch ( const Exception& )
+ aModuleIdentifier = xModuleManager->identify( m_xFrame );
+ xPersistentWindowStateSupplier->getByName( aModuleIdentifier ) >>= m_xPersistentWindowState;
+
+ Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier =
+ ModuleUIConfigurationManagerSupplier::create( comphelper::getComponentContext(m_xServiceManager) );
+ m_xModuleCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
+
+ Reference< XController > xController = m_xFrame->getController();
+ Reference< XModel > xModel;
+ if ( xController.is() )
+ xModel = xController->getModel();
+ if ( xModel.is() )
{
+ Reference< XUIConfigurationManagerSupplier > xUIConfigurationManagerSupplier( xModel, UNO_QUERY );
+ if ( xUIConfigurationManagerSupplier.is() )
+ m_xDocCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
}
+ m_aModuleIdentifier = aModuleIdentifier;
+ }
+ catch ( const Exception& )
+ {
}
}
}