diff options
author | Noel Grandin <noel@peralex.com> | 2013-02-26 16:24:53 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-07 08:23:38 +0200 |
commit | cd8ea20aa4b85128956a79c80f7953d30e99e802 (patch) | |
tree | 2ec962196db84427e97bbc9bb73f9566d70b6fd1 /cui | |
parent | fix spelling (diff) | |
download | core-cd8ea20aa4b85128956a79c80f7953d30e99e802.tar.gz core-cd8ea20aa4b85128956a79c80f7953d30e99e802.zip |
fdo#46808, Convert ui::UIConfigurationManager to new-style
Change-Id: I62c37eb6d0e0b2a681a84e1fa0067d0a9f967cf2
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index fb313b74a0f0..d2aa51208406 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -31,9 +31,6 @@ #include <sfx2/sfxresid.hxx> #include <svl/stritem.hxx> #include "svtools/treelistentry.hxx" -#include <com/sun/star/embed/StorageFactory.hpp> -#include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp> #include <sal/macros.h> @@ -44,20 +41,23 @@ //----------------------------------------------- // include interface declarations +#include <com/sun/star/awt/KeyModifier.hpp> +#include <com/sun/star/embed/StorageFactory.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/form/XReset.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XFrame.hpp> #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/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/UICommandDescription.hpp> +#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/UIConfigurationManager.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/awt/KeyModifier.hpp> -#include <com/sun/star/embed/XTransactedObject.hpp> -#include <com/sun/star/embed/ElementModes.hpp> - #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> //----------------------------------------------- @@ -77,7 +77,6 @@ using namespace com::sun::star; //----------------------------------------------- -static OUString SERVICE_UICONFIGMGR ("com.sun.star.ui.UIConfigurationManager" ); static OUString MODULEPROP_SHORTNAME ("ooSetupFactoryShortName" ); static OUString MODULEPROP_UINAME ("ooSetupFactoryUIName" ); @@ -1215,7 +1214,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl) GetTabDialog()->EnterWait(); css::uno::Reference< css::frame::XModel > xDoc ; - css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; + css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; css::uno::Reference< css::embed::XStorage > xRootStorage; // we must hold the root storage alive, if xCfgMgr is used! try @@ -1241,9 +1240,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl) css::uno::Reference< css::embed::XStorage > xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::READ); if (xUIConfig.is()) { - xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationStorage > xCfgMgrStore(xCfgMgr, css::uno::UNO_QUERY_THROW); - xCfgMgrStore->setStorage(xUIConfig); + css::uno::Reference< css::ui::XUIConfigurationManager2 > xCfgMgr2 = css::ui::UIConfigurationManager::create( comphelper::getComponentContext(m_xSMGR) ); + xCfgMgr2->setStorage(xUIConfig); + xCfgMgr.set( xCfgMgr2, css::uno::UNO_QUERY_THROW ); } } @@ -1299,7 +1298,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl) GetTabDialog()->EnterWait(); css::uno::Reference< css::frame::XModel > xDoc ; - css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; + css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; css::uno::Reference< css::embed::XStorage > xRootStorage; try @@ -1337,9 +1336,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl) if (sMediaType.isEmpty()) xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, css::uno::makeAny(MEDIATYPE_UICONFIG)); - xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationStorage > xUICfgStore(xCfgMgr, css::uno::UNO_QUERY_THROW); - xUICfgStore->setStorage(xUIConfig); + css::uno::Reference< css::ui::XUIConfigurationManager2 > xCfgMgr2 = css::ui::UIConfigurationManager::create( comphelper::getComponentContext(m_xSMGR) ); + xCfgMgr2->setStorage(xUIConfig); + xCfgMgr.set( xCfgMgr2, css::uno::UNO_QUERY_THROW ); } if (xCfgMgr.is()) @@ -1367,11 +1366,10 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl) if (xRootStorage.is()) { - css::uno::Reference< css::lang::XComponent > xComponent; - xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY); + css::uno::Reference< css::lang::XComponent > xComponent(xCfgMgr, css::uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); - xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY); + xComponent.set(xRootStorage, css::uno::UNO_QUERY); if (xComponent.is()) xComponent->dispose(); } |