summaryrefslogtreecommitdiff
path: root/framework/source/layoutmanager
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-30 14:02:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-31 15:31:36 +0100
commit0ac9a10d312dc8f12a74720ce211823ce4addf7b (patch)
tree2c812432eca9315170af8b5b6b7ae5bcbf828d5b /framework/source/layoutmanager
parentd27c92961b78da138d3563ab596cca416af9eb38 (diff)
fdo#46808, Deprecate configuration::ConfigurationProvider old-style service
...in favor of existing new-style configuration::theDefaultProvider singleton. Theoretically, ConfigurationProvider instances can be created with specific Locale and EnableAsync arguments, but this is hardly used in practice, and thus effectively all uses of the ConfigurationProvider service use the theDefaultProvider instance, anyway. theDefaultProvider is restricted to the XMultiServiceFactory interface, while ConfigurationProvider also makes available XComponent. However, dispose must not be called manually on theDefaultProvider singleton anyway, and calls to add-/removeEventListener are so few (and in dubious code that should better be cleaned up) that requiring an explicit queryInterface does not really hurt there. This commit originated as a patch by Noel Grandin to "Adapt configuration::ConfigurationProvider UNO service to new style [by creating] a merged XConfigurationProvider interface for this service to implement." It was then modified by Stephan Bergmann by deprecating ConfigurationProvider instead of adding XConfigurationProvider and by replacing calls to ConfigurationProvider::create with calls to theDefaultProvider::get. Change-Id: I9c16700afe0faff1ef6f20338a66bd7a9af990bd
Diffstat (limited to 'framework/source/layoutmanager')
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx4
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx16
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.hxx4
3 files changed, 12 insertions, 12 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 37e08e6f5e79..b29960cca32d 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -164,7 +164,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
m_aStatusBarElement.m_aType = rtl::OUString( "statusbar" );
m_aStatusBarElement.m_aName = m_aStatusBarAlias;
- m_pToolbarManager = new ToolbarLayoutManager( xServiceManager, m_xUIElementFactoryManager, this );
+ m_pToolbarManager = new ToolbarLayoutManager( comphelper::getComponentContext(xServiceManager), m_xUIElementFactoryManager, this );
m_xToolbarManager = uno::Reference< ui::XUIConfigurationListener >( static_cast< OWeakObject* >( m_pToolbarManager ), uno::UNO_QUERY );
Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
@@ -517,7 +517,7 @@ sal_Bool LayoutManager::implts_readWindowStateData( const rtl::OUString& aName,
GlobalSettings* pGlobalSettings( 0 );
if ( m_pGlobalSettings == 0 )
{
- m_pGlobalSettings = new GlobalSettings( m_xSMGR );
+ m_pGlobalSettings = new GlobalSettings( comphelper::getComponentContext(m_xSMGR) );
bGetSettingsState = sal_True;
}
pGlobalSettings = m_pGlobalSettings;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 0a67895c9b42..2bb41fe93235 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -56,11 +56,11 @@ namespace framework
{
ToolbarLayoutManager::ToolbarLayoutManager(
- const uno::Reference< lang::XMultiServiceFactory >& xSMGR,
+ const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Reference< ui::XUIElementFactory >& xUIElementFactory,
ILayoutNotifications* pParentLayouter )
: ThreadHelpBase( &Application::GetSolarMutex() ),
- m_xSMGR( xSMGR ),
+ m_xContext( rxContext),
m_xUIElementFactoryManager( xUIElementFactory ),
m_pParentLayouter( pParentLayouter ),
m_eDockOperation( DOCKOP_ON_COLROW ),
@@ -83,7 +83,7 @@ ToolbarLayoutManager::ToolbarLayoutManager(
setZeroRectangle( m_aDockingArea );
// create toolkit object
- m_xToolkit = awt::Toolkit::create( comphelper::getComponentContext(m_xSMGR) );
+ m_xToolkit = awt::Toolkit::create( m_xContext );
}
ToolbarLayoutManager::~ToolbarLayoutManager()
@@ -913,10 +913,10 @@ void ToolbarLayoutManager::setParentWindow(
{
static const char DOCKINGAREASTRING[] = "dockingarea";
- uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
- uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( comphelper::getComponentContext(m_xSMGR), xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xTopDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xLeftDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
+ uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY );
WriteGuard aWriteLock( m_aLock );
m_xContainerWindow = uno::Reference< awt::XWindow2 >( xParentWindow, uno::UNO_QUERY );
@@ -1582,7 +1582,7 @@ sal_Bool ToolbarLayoutManager::implts_readWindowStateData( const rtl::OUString&
GlobalSettings* pGlobalSettings( 0 );
if ( m_pGlobalSettings.get() == 0 )
{
- m_pGlobalSettings.reset( new GlobalSettings( m_xSMGR ) );
+ m_pGlobalSettings.reset( new GlobalSettings( m_xContext ) );
bGetSettingsState = true;
}
pGlobalSettings = m_pGlobalSettings.get();
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
index 2d4389428ea2..1237c147de4b 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx
@@ -90,7 +90,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
PREVIEWFRAME_YES
};
- ToolbarLayoutManager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMGR,
+ ToolbarLayoutManager( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElementFactory >& xUIElementFactory,
ILayoutNotifications* pParentLayouter );
virtual ~ToolbarLayoutManager();
@@ -299,7 +299,7 @@ class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::a
//---------------------------------------------------------------------------------------------------------
// members
//---------------------------------------------------------------------------------------------------------
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< css::awt::XWindow2 > m_xContainerWindow;
css::uno::Reference< css::awt::XWindow > m_xDockAreaWindows[DOCKINGAREAS_COUNT];