diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-23 17:46:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-03 15:55:03 +0200 |
commit | 10362695c2060f6aa48bd88f6b8dd6cfa556392a (patch) | |
tree | 47934dee52011b102f3dec35eda5888240920e68 | |
parent | a297372210396260da57f34da3790f76682603cc (diff) |
fdo#46808, Adapt ModuleUIConfigurationManagerSupplier UNO service to new style
Change-Id: I58b17349474b974edd24aa17ec08ffa848a92ae9
-rw-r--r-- | cui/source/customize/acccfg.cxx | 7 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/control/toolboxcontroller.cxx | 5 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 4 | ||||
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 9 | ||||
-rw-r--r-- | forms/source/helper/commandimageprovider.cxx | 5 | ||||
-rw-r--r-- | framework/source/lomenubar/FrameHelper.cxx | 3 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 2 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl | 28 | ||||
-rw-r--r-- | sc/source/filter/excel/xltoolbar.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgass.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/appl/imagemgr.cxx | 9 | ||||
-rw-r--r-- | svtools/source/misc/acceleratorexecute.cxx | 5 | ||||
-rw-r--r-- | svtools/source/uno/contextmenuhelper.cxx | 21 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8toolbar.cxx | 6 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 4 |
19 files changed, 77 insertions, 93 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index a9c5da44d742..eafc26afacd8 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -54,7 +54,7 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/form/XReset.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> @@ -67,6 +67,7 @@ //----------------------------------------------- // include other projects +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <svtools/acceleratorexecute.hxx> #include <svtools/svlbitm.hxx> @@ -93,7 +94,6 @@ static ::rtl::OUString SERVICE_UICONFIGMGR (RTL_CONSTASCII_USTRINGP static ::rtl::OUString SERVICE_DESKTOP (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" )); static ::rtl::OUString SERVICE_MODULEMANAGER (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager" )); static ::rtl::OUString SERVICE_GLOBALACCCFG (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.GlobalAcceleratorConfiguration" )); -static ::rtl::OUString SERVICE_MODULEUICONFIGSUPPLIER (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")); static ::rtl::OUString SERVICE_UICMDDESCRIPTION (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription" )); static ::rtl::OUString MODULEPROP_SHORTNAME (RTL_CONSTASCII_USTRINGPARAM("ooSetupFactoryShortName" )); @@ -877,7 +877,8 @@ void SfxAcceleratorConfigPage::InitAccCfg() m_xGlobal = css::uno::Reference< css::ui::XAcceleratorConfiguration >(m_xSMGR->createInstance(SERVICE_GLOBALACCCFG), css::uno::UNO_QUERY_THROW); // get module accelerator configuration - css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(m_xSMGR->createInstance(SERVICE_MODULEUICONFIGSUPPLIER), css::uno::UNO_QUERY_THROW); + + css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(css::ui::ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(m_xSMGR).getUNOContext())); css::uno::Reference< css::ui::XUIConfigurationManager > xUICfgManager = xModuleCfgSupplier->getUIConfigurationManager(m_sModuleLongName); m_xModule = css::uno::Reference< css::ui::XAcceleratorConfiguration >(xUICfgManager->getShortCutManager(), css::uno::UNO_QUERY_THROW); } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 9575d7257d28..325689946a1b 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -62,12 +62,13 @@ #include "eventdlg.hxx" #include <dialmgr.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/documentinfo.hxx> #include <comphelper/processfactory.hxx> #include <unotools/configmgr.hxx> #include <com/sun/star/ui/ItemType.hpp> #include <com/sun/star/ui/ItemStyle.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/ui/XUIConfiguration.hpp> @@ -1688,9 +1689,7 @@ void SvxConfigPage::Reset( const SfxItemSet& ) } uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > - xModuleCfgSupplier( xServiceManager->createInstance( - OUString( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" )), - uno::UNO_QUERY ); + xModuleCfgSupplier( css::ui::ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(xServiceManager).getUNOContext()) ); // Set up data for module specific menus SaveInData* pModuleData = NULL; diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index ab1f31b46c7f..5067b1634f5e 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -23,7 +23,7 @@ #include "dbu_app.hrc" #include "AppView.hxx" #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/ui/ImageType.hpp> #include <com/sun/star/sdbcx/XViewsSupplier.hpp> @@ -43,6 +43,7 @@ #include "dbtreelistbox.hxx" #include "IApplicationController.hxx" #include "imageprovider.hxx" +#include "comphelper/componentcontext.hxx" using namespace ::dbaui; using namespace ::com::sun::star::uno; @@ -475,11 +476,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) try { Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( - getDetailView()->getBorderWin().getView()->getORB()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) - ) , - UNO_QUERY - ); + ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(getDetailView()->getBorderWin().getView()->getORB()).getUNOContext()) ); Reference< XUIConfigurationManager > xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.OfficeDatabaseDocument" ) ) ); diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 6f95cc1a9c55..750289b5a4d7 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/ui/XImageManager.hpp> @@ -52,6 +52,7 @@ namespace dbaui using ::com::sun::star::container::XNameAccess; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::ui::ModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XUIConfigurationManager; using ::com::sun::star::ui::XImageManager; @@ -124,14 +125,12 @@ namespace dbaui do { // Retrieve popup menu labels - Reference< XMultiServiceFactory> xFactory( ::comphelper::getProcessServiceFactory() ); - if ( !xFactory.is() ) + Reference< com::sun::star::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + if ( !xContext.is() ) break; Reference< XModuleUIConfigurationManagerSupplier > xSupplier( - xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), - UNO_QUERY_THROW ); + ModuleUIConfigurationManagerSupplier::create(xContext) ); Reference< XUIConfigurationManager > xManager( xSupplier->getUIConfigurationManager( _rModuleName ) ); Reference< XImageManager > xImageManager; diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 6faa3bed4004..f5c28384d606 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -23,7 +23,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <vcl/menu.hxx> #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <vcl/svapp.hxx> @@ -36,6 +36,7 @@ #include <osl/mutex.hxx> #include "dbu_reghelper.hxx" #include "UITools.hxx" +#include <comphelper/componentcontext.hxx> extern "C" void SAL_CALL createRegistryInfo_OToolboxController() @@ -185,7 +186,7 @@ namespace dbaui try { - Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(getServiceManager()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),UNO_QUERY); + Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(getServiceManager()).getUNOContext())); Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"))); Reference<XImageManager> xImageMgr(xUIConfigMgr->getImageManager(),UNO_QUERY); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 8c17b8c286b3..87702bade412 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -60,6 +60,7 @@ #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/FileSystemStorageFactory.hpp> #include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfiguration.hpp> #include <com/sun/star/ui/XUIConfigurationStorage.hpp> #include <com/sun/star/ui/XUIConfigurationPersistence.hpp> @@ -1339,11 +1340,10 @@ void NewVersionUIInfo::init(const ::std::vector< MigrationModuleInfo >& vModules m_lNewVersionMenubarSettingsSeq.realloc(vModulesInfo.size()); m_lNewVersionToolbarSettingsSeq.realloc(vModulesInfo.size()); - const ::rtl::OUString sModuleCfgSupplier(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")); const ::rtl::OUString sMenubarResourceURL(RTL_CONSTASCII_USTRINGPARAM("private:resource/menubar/menubar")); const ::rtl::OUString sToolbarResourcePre(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/")); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier = uno::Reference< ui::XModuleUIConfigurationManagerSupplier >(::comphelper::getProcessServiceFactory()->createInstance(sModuleCfgSupplier), uno::UNO_QUERY); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier = ui::ModuleUIConfigurationManagerSupplier::create( ::comphelper::getProcessComponentContext() ); for (sal_uInt32 i=0; i<vModulesInfo.size(); ++i) { diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index b8930efede2d..05314398b6fa 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -65,7 +65,7 @@ #include <com/sun/star/ui/XUIElementSettings.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/embed/StateChangeInProgressException.hpp> @@ -74,6 +74,7 @@ #include <osl/diagnose.h> #include <rtl/process.h> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/namedvaluecollection.hxx> @@ -584,10 +585,8 @@ uno::Reference< container::XIndexAccess > DocumentHolder::RetrieveOwnMenu_Impl() if ( !aModuleIdent.isEmpty() ) { - uno::Reference< ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier > xModConfSupplier( - m_xFactory->createInstance( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModConfSupplier( + ui::ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(m_xFactory).getUNOContext()) ); uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > xModUIConfMan( xModConfSupplier->getUIConfigurationManager( aModuleIdent ), uno::UNO_QUERY_THROW ); diff --git a/forms/source/helper/commandimageprovider.cxx b/forms/source/helper/commandimageprovider.cxx index 878a72e93679..23d2023c18c3 100644 --- a/forms/source/helper/commandimageprovider.cxx +++ b/forms/source/helper/commandimageprovider.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/ui/ImageType.hpp> @@ -58,6 +58,7 @@ namespace frm using ::com::sun::star::ui::XUIConfigurationManagerSupplier; using ::com::sun::star::ui::XUIConfigurationManager; using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier; + using ::com::sun::star::ui::ModuleUIConfigurationManagerSupplier; using ::com::sun::star::frame::XModuleManager; using ::com::sun::star::graphic::XGraphic; /** === end UNO using === **/ @@ -114,7 +115,7 @@ namespace frm ::rtl::OUString sModuleID = xModuleManager->identify( _rxDocument ); Reference< XModuleUIConfigurationManagerSupplier > xSuppUIConfig( - _rContext.createComponent( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ), UNO_QUERY_THROW ); + ModuleUIConfigurationManagerSupplier::create(_rContext.getUNOContext()) ); Reference< XUIConfigurationManager > xUIConfig( xSuppUIConfig->getUIConfigurationManager( sModuleID ), UNO_SET_THROW ); m_xModuleImageManager.set( xUIConfig->getImageManager(), UNO_QUERY_THROW ); diff --git a/framework/source/lomenubar/FrameHelper.cxx b/framework/source/lomenubar/FrameHelper.cxx index 91ae62b79d37..4193b2e280f7 100644 --- a/framework/source/lomenubar/FrameHelper.cxx +++ b/framework/source/lomenubar/FrameHelper.cxx @@ -792,8 +792,7 @@ FrameHelper::getAcceleratorConfigurations (Reference < XModel > xModel, this->m_docAccelConf = docAccelConf; //Get module shurtcut database - Reference< XModuleUIConfigurationManagerSupplier > modUISupplier(m_xMSF->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))), - UNO_QUERY); + Reference< XModuleUIConfigurationManagerSupplier > modUISupplier( ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(m_xMSF).getUNOContext()) ); Reference< XUIConfigurationManager > modUIManager = modUISupplier->getUIConfigurationManager(xModuleManager->identify(m_xFrame)); Reference< XAcceleratorConfiguration > modAccelConf(modUIManager->getShortCutManager(), UNO_QUERY); this->m_modAccelConf = modAccelConf; diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index bf42a4ece481..a3fe86f5aa6e 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -276,6 +276,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ucb,\ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ui,\ GlobalAcceleratorConfiguration \ + ModuleUIConfigurationManagerSupplier \ WindowContentFactory \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ui/dialogs,\ @@ -1456,7 +1457,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/ui,\ ModuleUICategoryDescription \ ModuleUICommandDescription \ ModuleUIConfigurationManager \ - ModuleUIConfigurationManagerSupplier \ ModuleWindowStateConfiguration \ UICategoryDescription \ UICommandDescription \ diff --git a/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl b/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl index f2fb7b15e148..48ea9b7b95ed 100644 --- a/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl +++ b/offapi/com/sun/star/ui/ModuleUIConfigurationManagerSupplier.idl @@ -37,23 +37,19 @@ module com { module sun { module star { module ui { access to module based user interface configuration managers. @since OOo 2.0 -*/ -service ModuleUIConfigurationManagerSupplier -{ - /** controls module based user interface configuration managers. - - <p> - There can only exists one user interface configuration manager for - a module. A user interface configuration manager supports to get and set - user interface configuration data for configurable user interface elements. - - @see ConfigurableUIElement - @see XUIConfigurationManager - </p> - */ - interface XModuleUIConfigurationManagerSupplier; -}; + Controls module based user interface configuration managers. + + <p> + There can only exists one user interface configuration manager for + a module. A user interface configuration manager supports to get and set + user interface configuration data for configurable user interface elements. + + @see ConfigurableUIElement + @see XUIConfigurationManager + </p> +*/ +service ModuleUIConfigurationManagerSupplier : XModuleUIConfigurationManagerSupplier; }; }; }; }; diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index 8b7054ebf5c2..b8fd7539aa79 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -32,7 +32,7 @@ #include <rtl/ustrbuf.hxx> #include <stdarg.h> #include <com/sun/star/ui/XUIConfigurationPersistence.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -420,12 +420,16 @@ CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) { + if(rCTB.empty()) + return true; + + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( ui::ModuleUIConfigurationManagerSupplier::create(xContext) ); + std::vector<CTB>::iterator it_end = rCTB.end(); for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) { // for each customtoolbar - uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW ); CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) ); helper.setMSOCommandMap( new MSOExcelCommandConvertor() ); // Ignore menu toolbars, excel doesn't ( afaics ) store diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 2d06f8213a10..184800397abf 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -51,7 +51,7 @@ #include <com/sun/star/script/vba/XVBAEventProcessor.hpp> #include <com/sun/star/sheet/XSpreadsheetView.hpp> #include <com/sun/star/task/XJob.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XAcceleratorConfiguration.hpp> #include "scabstdlg.hxx" @@ -2858,16 +2858,12 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ) { using namespace ::com::sun::star::ui; - Reference<XMultiServiceFactory> xServiceManager = ::comphelper::getProcessServiceFactory(); - if (!xServiceManager.is()) + Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); + if (!xContext.is()) return; Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgSupplier( - xServiceManager->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))), UNO_QUERY); - - if (!xModuleCfgSupplier.is()) - return; + ModuleUIConfigurationManagerSupplier::create(xContext) ); // Grab the Calc configuration. Reference<XUIConfigurationManager> xConfigMgr = diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 53c9bbc1812e..75f1217c00a0 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -61,7 +61,7 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/ucb/XSimpleFileAccess2.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <unotools/historyoptions.hxx> @@ -1811,16 +1811,15 @@ Image AssistentDlgImpl::GetUiIconForCommand (const ::rtl::OUString& sCommandURL) break; // Retrieve popup menu labels - Reference<lang::XMultiServiceFactory> xFactory ( - ::comphelper::getProcessServiceFactory ()); - if ( ! xFactory.is()) + Reference<uno::XComponentContext> xContext ( + ::comphelper::getProcessComponentContext()); + if ( ! xContext.is()) break; ::rtl::OUString sModuleIdentifier ("com.sun.star.presentation.PresentationDocument"); - Reference<com::sun::star::ui::XModuleUIConfigurationManagerSupplier> xSupplier ( - xFactory->createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"), - UNO_QUERY_THROW); + Reference<ui::XModuleUIConfigurationManagerSupplier> xSupplier ( + ui::ModuleUIConfigurationManagerSupplier::create(xContext)); Reference<com::sun::star::ui::XUIConfigurationManager> xManager ( xSupplier->getUIConfigurationManager(sModuleIdentifier)); diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 71d2e0c8b798..216e81bf829e 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/frame/XModuleManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/ImageType.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> @@ -176,11 +176,8 @@ Image SAL_CALL GetImage( if ( !xModuleCfgMgrSupplier.is() ) { - xModuleCfgMgrSupplier = Reference< XModuleUIConfigurationManagerSupplier >( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))), - UNO_QUERY ); + xModuleCfgMgrSupplier = ModuleUIConfigurationManagerSupplier::create( + ::comphelper::getProcessComponentContext() ); m_xModuleCfgMgrSupplier = xModuleCfgMgrSupplier; } diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 14d54251e0cb..bb07a8917fa8 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -31,7 +31,7 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/KeyModifier.hpp> @@ -403,8 +403,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st { return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); } css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier( - xSMGR->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))), - css::uno::UNO_QUERY_THROW); + css::ui::ModuleUIConfigurationManagerSupplier::create(comphelper::ComponentContext(xSMGR).getUNOContext()) ); css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg; try diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index 541b3c920dfb..3942760e5a4c 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -38,7 +38,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/ImageType.hpp> #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -430,19 +430,14 @@ ContextMenuHelper::associateUIConfigurationManagers() aModuleId = xModuleManager->identify( xFrame ); uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( - ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))), - uno::UNO_QUERY ); - if ( xModuleCfgMgrSupplier.is() ) + ui::ModuleUIConfigurationManagerSupplier::create( + ::comphelper::getProcessComponentContext() ) ); + uno::Reference< ui::XUIConfigurationManager > xUICfgMgr( + xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId )); + if ( xUICfgMgr.is() ) { - uno::Reference< ui::XUIConfigurationManager > xUICfgMgr( - xModuleCfgMgrSupplier->getUIConfigurationManager( aModuleId )); - if ( xUICfgMgr.is() ) - { - m_xModuleImageMgr = uno::Reference< ui::XImageManager >( - xUICfgMgr->getImageManager(), uno::UNO_QUERY ); - } + m_xModuleImageMgr = uno::Reference< ui::XImageManager >( + xUICfgMgr->getImageManager(), uno::UNO_QUERY ); } } diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 0b668fa69d03..ff1ae4971bf4 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -33,7 +33,7 @@ #include <rtl/ustrbuf.hxx> #include <stdarg.h> #include <com/sun/star/ui/XUIConfigurationPersistence.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -240,8 +240,8 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) { try { - uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( ui::ModuleUIConfigurationManagerSupplier::create(xContext) ); CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( "com.sun.star.text.TextDocument" ) ); helper.setMSOCommandMap( new MSOWordCommandConvertor() ); diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 05772c178c18..b29d01463041 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include "vbacommandbarhelper.hxx" +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationStorage.hpp> #include <com/sun/star/ui/XModuleUIConfigurationManager.hpp> @@ -112,7 +113,8 @@ void VbaCommandBarHelper::Init( ) throw (css::uno::RuntimeException) uno::Reference< lang::XMultiServiceFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( xServiceManager->createInstance( rtl::OUString( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" )), uno::UNO_QUERY_THROW ); + css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp( + css::ui::ModuleUIConfigurationManagerSupplier::create(mxContext) ); m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW ); |