diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-11 11:27:08 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-13 05:20:58 +0200 |
commit | b552f521f6bbf917ae41ccfcddeb498c75c824e3 (patch) | |
tree | ae21fbb700814e8b31bca384f47f68b0a5e71145 /sfx2/source/toolbox/tbxitem.cxx | |
parent | bb8900baaaaa489442a5bd805bb42d43cd6fc152 (diff) |
fdo#46808, Adapt ui::UIElementFactoryManager UNO service to new style
Required creating a new merged interface.
Change-Id: I12be54e7e4c0614a31a04715342aa244d1687c42
Diffstat (limited to 'sfx2/source/toolbox/tbxitem.cxx')
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index d67b789a6053..340924714d38 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/ui/XUIFunctionListener.hpp> +#include <com/sun/star/ui/UIElementFactoryManager.hpp> #include <com/sun/star/frame/status/Visibility.hpp> #include <svl/eitem.hxx> #include <svl/stritem.hxx> @@ -774,7 +775,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSub if ( pImpl->pBox ) { - static WeakReference< XUIElementFactory > xWeakUIElementFactory; + static WeakReference< XUIElementFactoryManager > xWeakUIElementFactory; sal_uInt16 nItemId = pImpl->pBox->GetDownItemId(); @@ -785,16 +786,13 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSub Reference< XMultiServiceFactory > xServiceManager = getServiceManager(); Reference< XFrame > xFrame = getFrameInterface(); Reference< XUIElement > xUIElement; - Reference< XUIElementFactory > xUIEementFactory; + Reference< XUIElementFactoryManager > xUIElementFactory; - xUIEementFactory = xWeakUIElementFactory; - if ( !xUIEementFactory.is() ) + xUIElementFactory = xWeakUIElementFactory; + if ( !xUIElementFactory.is() ) { - xUIEementFactory = Reference< XUIElementFactory >( - xServiceManager->createInstance( - rtl::OUString( "com.sun.star.ui.UIElementFactoryManager" )), - UNO_QUERY ); - xWeakUIElementFactory = xUIEementFactory; + xUIElementFactory = UIElementFactoryManager::create( comphelper::getComponentContext(xServiceManager) ); + xWeakUIElementFactory = xUIElementFactory; } Sequence< PropertyValue > aPropSeq( 3 ); @@ -807,7 +805,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSub try { - xUIElement = xUIEementFactory->createUIElement( rSubToolBarResName, aPropSeq ); + xUIElement = xUIElementFactory->createUIElement( rSubToolBarResName, aPropSeq ); } catch ( ::com::sun::star::container::NoSuchElementException& ) { |