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 | |
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')
-rw-r--r-- | sfx2/source/dialog/taskpane.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index fa73b7523b2e..a92d27e0330d 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/awt/XControl.hpp> +#include <com/sun/star/ui/UIElementFactoryManager.hpp> #include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> @@ -76,6 +77,8 @@ namespace sfx2 using ::com::sun::star::container::XNameAccess; using ::com::sun::star::ui::XToolPanel; using ::com::sun::star::ui::XUIElementFactory; + using ::com::sun::star::ui::XUIElementFactoryManager; + using ::com::sun::star::ui::UIElementFactoryManager; using ::com::sun::star::ui::XUIElement; using ::com::sun::star::awt::XWindow; using ::com::sun::star::frame::XFrame; @@ -357,8 +360,7 @@ namespace sfx2 m_bAttemptedCreation = true; try { - const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - const Reference< XUIElementFactory > xFactory( aContext.createComponent( "com.sun.star.ui.UIElementFactoryManager" ), UNO_QUERY_THROW ); + const Reference< XUIElementFactoryManager > xFactory = UIElementFactoryManager::create( ::comphelper::getProcessComponentContext() ); ::comphelper::NamedValueCollection aCreationArgs; aCreationArgs.put( "Frame", makeAny( m_xFrame ) ); 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& ) { |