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 /sc | |
parent | a297372210396260da57f34da3790f76682603cc (diff) |
fdo#46808, Adapt ModuleUIConfigurationManagerSupplier UNO service to new style
Change-Id: I58b17349474b974edd24aa17ec08ffa848a92ae9
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xltoolbar.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 12 |
2 files changed, 11 insertions, 11 deletions
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 = |