From 6a1c29d7efd505346d4b43ee2b7080e8d769301e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 5 Sep 2012 22:46:40 +0200 Subject: offapi: move css.ui.UICommandDescription to css.frame.UICommandDescription: The service implementation used "com.sun.star.frame.UICommandDescription" since forever, so the IDL file was essentially wrong documentation. But since 7a464263cc5c2ca2b7128734ff4860e02d662818 converted the service to new-style, it cannot be instantated any more and e.g. clicking on Tools->Customize crashes. (Adapting the implementation instead would be an incompatible change.) Change-Id: I564bddaf3836827f5b72360a2bde19d6158b7ba5 --- cui/source/customize/acccfg.cxx | 5 +- cui/source/customize/cfg.cxx | 5 +- cui/source/customize/cfgutil.cxx | 5 +- cui/source/customize/selector.cxx | 5 +- dbaccess/source/ui/control/opendoccontrols.cxx | 4 +- desktop/source/app/app.cxx | 5 +- desktop/source/migration/migration.cxx | 6 ++- forms/source/helper/commanddescriptionprovider.cxx | 4 +- framework/source/lomenubar/FrameHelper.cxx | 4 +- offapi/UnoApi_offapi.mk | 2 +- offapi/com/sun/star/frame/UICommandDescription.idl | 56 ++++++++++++++++++++++ offapi/com/sun/star/ui/UICommandDescription.idl | 56 ---------------------- sd/source/ui/dlg/dlgass.cxx | 5 +- sd/source/ui/view/ViewShellBase.cxx | 5 +- sfx2/source/dialog/recfloat.cxx | 4 +- sfx2/source/dialog/templdlg.cxx | 5 +- sfx2/source/view/viewsh.cxx | 5 +- svtools/source/uno/contextmenuhelper.cxx | 5 +- sw/source/ui/lingu/olmenu.cxx | 7 ++- 19 files changed, 104 insertions(+), 89 deletions(-) create mode 100644 offapi/com/sun/star/frame/UICommandDescription.idl delete mode 100644 offapi/com/sun/star/ui/UICommandDescription.idl diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 957eb381670f..8ed9d6c09381 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include #include @@ -852,7 +852,8 @@ void SfxAcceleratorConfigPage::InitAccCfg() // no - initialize this instance m_xSMGR = ::comphelper::getProcessServiceFactory(); - m_xUICmdDescription = css::ui::UICommandDescription::create(comphelper::ComponentContext(m_xSMGR).getUNOContext()); + m_xUICmdDescription = css::frame::UICommandDescription::create( + comphelper::ComponentContext(m_xSMGR).getUNOContext()); // get the current active frame, which should be our "parent" // for this session diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 0a0e70611516..626a25dd6828 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -75,7 +75,7 @@ #include #include #include -#include +#include #include #include #include @@ -914,7 +914,8 @@ SaveInData::SaveInData( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNameAccess( - css::ui::UICommandDescription::create(comphelper::ComponentContext(m_xServiceManager).getUNOContext()) ); + css::frame::UICommandDescription::create( + comphelper::ComponentContext(m_xServiceManager).getUNOContext()) ); xNameAccess->getByName( aModuleId ) >>= m_xCommandToLabelMap; diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 44cd36bebcbf..0f08675ec4da 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include "acccfg.hrc" #include "helpid.hrc" @@ -586,7 +586,8 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW); m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW); - m_xUICmdDescription = css::ui::UICommandDescription::create(::comphelper::ComponentContext(m_xSMGR).getUNOContext()); + m_xUICmdDescription = css::frame::UICommandDescription::create( + ::comphelper::ComponentContext(m_xSMGR).getUNOContext()); InitModule(); InitBasic(); diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 8ccafd287706..280393a6486f 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -62,7 +62,7 @@ #include #include #include -#include +#include using ::rtl::OUString; using namespace ::com::sun::star; @@ -425,7 +425,8 @@ void SvxConfigGroupListBox_Impl::Init() }catch(const uno::Exception&) { aModuleId = ::rtl::OUString(); } - Reference< container::XNameAccess > xNameAccess( ui::UICommandDescription::create(xContext) ); + Reference< container::XNameAccess > const xNameAccess( + frame::UICommandDescription::create(xContext) ); xNameAccess->getByName( aModuleId ) >>= m_xModuleCommands; Reference< container::XNameAccess > xAllCategories( diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 693c02b19e67..886cdc11e3d5 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ namespace dbaui using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XUIConfigurationManager; using ::com::sun::star::ui::XImageManager; - using ::com::sun::star::ui::UICommandDescription; + using ::com::sun::star::frame::UICommandDescription; using ::com::sun::star::graphic::XGraphic; String GetCommandText( const sal_Char* _pCommandURL, const ::rtl::OUString& _rModuleName ) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d6e3cd7a0d52..7208345650d3 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include @@ -2092,7 +2092,8 @@ void Desktop::PreloadConfigurationData() { Reference< XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory(); Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XNameAccess > xNameAccess( css::ui::UICommandDescription::create(xContext) ); + Reference< XNameAccess > xNameAccess( + css::frame::UICommandDescription::create(xContext) ); rtl::OUString aWriterDoc( "com.sun.star.text.TextDocument" ); rtl::OUString aCalcDoc( "com.sun.star.sheet.SpreadsheetDocument" ); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 57e93aba893f..fe98ad01036f 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,7 +92,9 @@ static const char XDG_CONFIG_PART[] = "/.config"; ::rtl::OUString sLabel; uno::Reference< container::XNameAccess > xUICommands; - uno::Reference< container::XNameAccess > xNameAccess( ui::UICommandDescription::create(::comphelper::getProcessComponentContext()) ); + uno::Reference< container::XNameAccess > const xNameAccess( + frame::UICommandDescription::create( + ::comphelper::getProcessComponentContext()) ); xNameAccess->getByName( sModuleIdentifier ) >>= xUICommands; if (xUICommands.is()) { diff --git a/forms/source/helper/commanddescriptionprovider.cxx b/forms/source/helper/commanddescriptionprovider.cxx index 900e3ceed558..fe17051febea 100644 --- a/forms/source/helper/commanddescriptionprovider.cxx +++ b/forms/source/helper/commanddescriptionprovider.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -51,7 +51,7 @@ namespace frm using ::com::sun::star::frame::ModuleManager; using ::com::sun::star::frame::XModuleManager2; using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::ui::UICommandDescription; + using ::com::sun::star::frame::UICommandDescription; /** === end UNO using === **/ //==================================================================== diff --git a/framework/source/lomenubar/FrameHelper.cxx b/framework/source/lomenubar/FrameHelper.cxx index e8fd68fb24ea..4452a02cda73 100644 --- a/framework/source/lomenubar/FrameHelper.cxx +++ b/framework/source/lomenubar/FrameHelper.cxx @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include #include @@ -114,7 +114,7 @@ using com::sun::star::uno::Sequence; using com::sun::star::uno::XComponentContext; using com::sun::star::uno::XInterface; using com::sun::star::ui::XUIElement; -using com::sun::star::ui::UICommandDescription; +using com::sun::star::frame::UICommandDescription; using com::sun::star::ui::XUIConfigurationManager; using com::sun::star::ui::XUIConfigurationManagerSupplier; using com::sun::star::ui::XAcceleratorConfiguration; diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 8a56c3b87939..db5f8ccec969 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -135,6 +135,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\ DocumentTemplates \ MediaTypeDetectionHelper \ ModuleManager \ + UICommandDescription \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/graphic,\ GraphicObject \ @@ -290,7 +291,6 @@ $(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 \ - UICommandDescription \ WindowContentFactory \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ui/dialogs,\ diff --git a/offapi/com/sun/star/frame/UICommandDescription.idl b/offapi/com/sun/star/frame/UICommandDescription.idl new file mode 100644 index 000000000000..1f2d3cd1ab71 --- /dev/null +++ b/offapi/com/sun/star/frame/UICommandDescription.idl @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_frame_UICommandDescription_idl__ +#define __com_sun_star_frame_UICommandDescription_idl__ + +#include + + +module com { module sun { module star { module frame { + + +/** a service which provides information about user interface commands of modules. + +

+ OpenOffice.org has an amount of commands that can be used by user interface + elements. This service provides access to the user interface commands that + are part of OpenOffice.org modules, like Writer or Calc. +

+ + @since OOo 2.0 + + Provides access to user interface commands of the installed modules. + +

+ To access the user interface command description of a module, a unique module specifier + must be provided to XNameAccess::getByName() function. + The module specifier can be retrieved from the ModuleManager + service. The interface provides references to ModuleUICommandDescription. +

+ + @see com::sun::star::frame::ModuleManager +*/ +service UICommandDescription : com::sun::star::container::XNameAccess; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/UICommandDescription.idl b/offapi/com/sun/star/ui/UICommandDescription.idl deleted file mode 100644 index c5b8b76f554d..000000000000 --- a/offapi/com/sun/star/ui/UICommandDescription.idl +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef __com_sun_star_ui_UICommandDescription_idl__ -#define __com_sun_star_ui_UICommandDescription_idl__ - -#include - - -module com { module sun { module star { module ui { - - -/** a service which provides information about user interface commands of modules. - -

- OpenOffice.org has an amount of commands that can be used by user interface - elements. This service provides access to the user interface commands that - are part of OpenOffice.org modules, like Writer or Calc. -

- - @since OOo 2.0 - - Provides access to user interface commands of the installed modules. - -

- To access the user interface command description of a module, a unique module specifier - must be provided to XNameAccess::getByName() function. - The module specifier can be retrieved from the ModuleManager - service. The interface provides references to ModuleUICommandDescription. -

- - @see com::sun::star::frame::ModuleManager -*/ -service UICommandDescription : com::sun::star::container::XNameAccess; - -}; }; }; }; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 62373201ae30..c34bb2ed116a 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include @@ -1757,7 +1757,8 @@ String AssistentDlgImpl::GetUiTextForCommand (const ::rtl::OUString& sCommandURL if ( ! xContext.is()) break; - Reference xNameAccess ( ui::UICommandDescription::create(xContext) ); + Reference const xNameAccess( + frame::UICommandDescription::create(xContext) ); Any a = xNameAccess->getByName( "com.sun.star.presentation.PresentationDocument"); a >>= xUICommandLabels; diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 624c25f62410..764884112fae 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include "ViewShellBase.hxx" #include @@ -1149,7 +1149,8 @@ void ViewShellBase::SetViewTabBar (const ::rtl::Reference& rViewTabB if( !aModuleIdentifier.isEmpty() ) { - Reference< XNameAccess > xNameAccess( ui::UICommandDescription::create(xContext) ); + Reference< XNameAccess > const xNameAccess( + frame::UICommandDescription::create(xContext) ); Reference< ::com::sun::star::container::XNameAccess > m_xUICommandLabels( xNameAccess->getByName( aModuleIdentifier ), UNO_QUERY_THROW ); Sequence< PropertyValue > aPropSeq; if( m_xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq ) diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index edb28dc22818..e1b1dad6980b 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -63,7 +63,7 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c xUICommandDescription = xTmpNameAccess; if ( !xUICommandDescription.is() ) { - xUICommandDescription = ui::UICommandDescription::create(xContext); + xUICommandDescription = frame::UICommandDescription::create(xContext); xTmpNameAccess = xUICommandDescription; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 7e994dcfd9fb..df3a812d358c 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "sfx2/sfxhelp.hxx" #include @@ -2534,7 +2534,8 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) //create a popup menu in Writer boost::scoped_ptr pMenu(new PopupMenu); uno::Reference< container::XNameAccess > xNameAccess( - ui::UICommandDescription::create(::comphelper::getProcessComponentContext()) ); + frame::UICommandDescription::create( + ::comphelper::getProcessComponentContext()) ); uno::Reference< container::XNameAccess > xUICommands; rtl::OUString sTextDoc("com.sun.star.text.TextDocument"); if(xNameAccess->hasByName(sTextDoc)) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 0a4a0def55e5..9af76d8953a8 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include @@ -248,7 +248,8 @@ static ::rtl::OUString RetrieveLabelFromCommand( if ( !xNameAccess.is() ) { xNameAccess = css::uno::Reference< css::container::XNameAccess >( - css::ui::UICommandDescription::create(comphelper::ComponentContext(xSMGR).getUNOContext()), + css::frame::UICommandDescription::create( + comphelper::ComponentContext(xSMGR).getUNOContext()), css::uno::UNO_QUERY_THROW ); s_xNameAccess = xNameAccess; } diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx index a452e6b95b30..4b31039d8b50 100644 --- a/svtools/source/uno/contextmenuhelper.cxx +++ b/svtools/source/uno/contextmenuhelper.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -437,7 +437,8 @@ ContextMenuHelper::associateUIConfigurationManagers() } uno::Reference< container::XNameAccess > xNameAccess( - ui::UICommandDescription::create(::comphelper::getProcessComponentContext()), + frame::UICommandDescription::create( + ::comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); try { diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 956c87ddb03e..4570e82b25f1 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -89,7 +89,7 @@ #include #include #include -#include +#include using namespace ::com::sun::star; @@ -333,7 +333,10 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) { try { - uno::Reference< container::XNameAccess > xNameAccess( ui::UICommandDescription::create(::comphelper::getProcessComponentContext() ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > const xNameAccess( + frame::UICommandDescription::create( + ::comphelper::getProcessComponentContext() ), + uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xUICommandLabels; uno::Any a = xNameAccess->getByName( "com.sun.star.text.TextDocument" ); uno::Reference< container::XNameAccess > xUICommands; -- cgit v1.2.3