fdo#46808, Adapt ModuleUIConfigurationManagerSupplier UNO service to new style

Change-Id: I58b17349474b974edd24aa17ec08ffa848a92ae9
This commit is contained in:
Noel Grandin 2012-08-23 17:46:39 +02:00 committed by Stephan Bergmann
parent a297372210
commit 10362695c2
19 changed files with 77 additions and 93 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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" ) )
);

View File

@ -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;

View File

@ -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);

View File

@ -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)
{

View File

@ -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 );

View File

@ -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 );

View File

@ -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;

View File

@ -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 \

View File

@ -37,23 +37,19 @@ module com { module sun { module star { module ui {
access to module based user interface configuration managers.
@since OOo 2.0
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
{
/** 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;
};
service ModuleUIConfigurationManagerSupplier : XModuleUIConfigurationManagerSupplier;
}; }; }; };

View File

@ -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

View File

@ -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 =

View File

@ -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));

View File

@ -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;
}

View File

@ -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

View File

@ -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 );
}
}

View File

@ -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() );

View File

@ -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 );