diff options
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 = |