diff options
-rw-r--r-- | cui/source/customize/cfg.cxx | 31 | ||||
-rw-r--r-- | cui/source/options/optpath.cxx | 150 | ||||
-rw-r--r-- | framework/inc/services.h | 2 | ||||
-rw-r--r-- | framework/inc/services/pathsettings.hxx | 146 | ||||
-rw-r--r-- | framework/source/accelerators/presethandler.cxx | 22 | ||||
-rw-r--r-- | framework/source/services/pathsettings.cxx | 32 | ||||
-rw-r--r-- | linguistic/source/misc2.cxx | 41 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/util/PathSettings.idl | 111 | ||||
-rw-r--r-- | offapi/com/sun/star/util/XPathSettings.idl | 138 | ||||
-rw-r--r-- | offapi/type_reference/offapi.rdb | bin | 6812672 -> 6834688 bytes | |||
-rw-r--r-- | sc/source/ui/vba/vbaapplication.cxx | 35 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaoptions.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaoptions.hxx | 3 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 20 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 11 |
16 files changed, 459 insertions, 296 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 2adfb0aace50..4aad676607b5 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -62,13 +62,20 @@ #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/ModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/FileSystemStorageFactory.hpp> +#include <com/sun/star/frame/XFramesSupplier.hpp> +#include <com/sun/star/frame/XFrames.hpp> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/UICommandDescription.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> +#include <com/sun/star/ui/ItemType.hpp> +#include <com/sun/star/ui/ItemStyle.hpp> +#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfiguration.hpp> #include <com/sun/star/ui/XUIConfigurationListener.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> @@ -79,16 +86,10 @@ #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/ui/ImageType.hpp> #include <com/sun/star/ui/WindowStateConfiguration.hpp> -#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> -#include <com/sun/star/frame/XFramesSupplier.hpp> -#include <com/sun/star/frame/XFrames.hpp> -#include <com/sun/star/frame/FrameSearchFlag.hpp> -#include <com/sun/star/graphic/GraphicProvider.hpp> -#include <com/sun/star/embed/ElementModes.hpp> -#include <com/sun/star/embed/FileSystemStorageFactory.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include "dlgname.hxx" @@ -5013,15 +5014,11 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, m_xGraphProvider = uno::Reference< graphic::XGraphicProvider >( graphic::GraphicProvider::create( xComponentContext ) ); - uno::Reference< beans::XPropertySet > xPropSet( - xServiceManager->createInstance( OUString("com.sun.star.util.PathSettings" ) ), - uno::UNO_QUERY ); - - uno::Any aAny = xPropSet->getPropertyValue( OUString( "UserConfig" ) ); + uno::Reference< css::util::XPathSettings > xPathSettings = + css::util::PathSettings::create( xComponentContext ); - OUString aDirectory; - aAny >>= aDirectory; + OUString aDirectory = xPathSettings->getUserConfig(); sal_Int32 aCount = aDirectory.getLength(); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index dfc13a1b29ff..774d3356f7dd 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/FolderPicker.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include <officecfg/Office/Common.hxx> #include "optHeaderTabListbox.hxx" #include <readonlyimage.hxx> @@ -77,7 +78,7 @@ struct OptPath_Impl SvtDefaultOptions m_aDefOpt; Image m_aLockImage; OUString m_sMultiPathDlg; - Reference< XPropertySet > m_xPathSettings; + Reference< css::util::XPathSettings > m_xPathSettings; OptPath_Impl(const Image& rLockImage, const OUString& rMultiPathDlg) : m_aLockImage(rLockImage) @@ -716,66 +717,61 @@ void SvxPathTabPage::GetPathList( { String sCfgName = getCfgName_Impl( _nPathHandle ); - // load PathSettings service if necessary - if ( !pImpl->m_xPathSettings.is() ) - { - Reference< XMultiServiceFactory > xSMgr = comphelper::getProcessServiceFactory(); - pImpl->m_xPathSettings = Reference< XPropertySet >( xSMgr->createInstance( - OUString( "com.sun.star.util.PathSettings" ) ), UNO_QUERY ); - } - try { - if ( pImpl->m_xPathSettings.is() ) + // load PathSettings service if necessary + if ( !pImpl->m_xPathSettings.is() ) { - // load internal paths - String sProp( sCfgName ); - sProp = sCfgName; - sProp += POSTFIX_INTERNAL; - Any aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); - Sequence< OUString > aPathSeq; - if ( aAny >>= aPathSeq ) - { - long i, nCount = aPathSeq.getLength(); - const OUString* pPaths = aPathSeq.getConstArray(); + Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + pImpl->m_xPathSettings = css::util::PathSettings::create( xContext ); + } - for ( i = 0; i < nCount; ++i ) - { - if ( _rInternalPath.Len() > 0 ) - _rInternalPath += ';'; - _rInternalPath += String( pPaths[i] ); - } - } - // load user paths - sProp = sCfgName; - sProp += POSTFIX_USER; - aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); - if ( aAny >>= aPathSeq ) + // load internal paths + String sProp( sCfgName ); + sProp += POSTFIX_INTERNAL; + Any aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); + Sequence< OUString > aPathSeq; + if ( aAny >>= aPathSeq ) + { + long i, nCount = aPathSeq.getLength(); + const OUString* pPaths = aPathSeq.getConstArray(); + + for ( i = 0; i < nCount; ++i ) { - long i, nCount = aPathSeq.getLength(); - const OUString* pPaths = aPathSeq.getConstArray(); + if ( _rInternalPath.Len() > 0 ) + _rInternalPath += ';'; + _rInternalPath += String( pPaths[i] ); + } + } + // load user paths + sProp = sCfgName; + sProp += POSTFIX_USER; + aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); + if ( aAny >>= aPathSeq ) + { + long i, nCount = aPathSeq.getLength(); + const OUString* pPaths = aPathSeq.getConstArray(); - for ( i = 0; i < nCount; ++i ) - { - if ( _rUserPath.Len() > 0 ) - _rUserPath += ';'; - _rUserPath += String( pPaths[i] ); - } + for ( i = 0; i < nCount; ++i ) + { + if ( _rUserPath.Len() > 0 ) + _rUserPath += ';'; + _rUserPath += String( pPaths[i] ); } - // then the writable path - sProp = sCfgName; - sProp += POSTFIX_WRITABLE; - aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); - OUString sWritablePath; - if ( aAny >>= sWritablePath ) - _rWritablePath = String( sWritablePath ); - - // and the readonly flag - sProp = sCfgName; - Reference< XPropertySetInfo > xInfo = pImpl->m_xPathSettings->getPropertySetInfo(); - Property aProp = xInfo->getPropertyByName( sProp ); - _rReadOnly = ( ( aProp.Attributes & PropertyAttribute::READONLY ) == PropertyAttribute::READONLY ); } + // then the writable path + sProp = sCfgName; + sProp += POSTFIX_WRITABLE; + aAny = pImpl->m_xPathSettings->getPropertyValue( sProp ); + OUString sWritablePath; + if ( aAny >>= sWritablePath ) + _rWritablePath = String( sWritablePath ); + + // and the readonly flag + sProp = sCfgName; + Reference< XPropertySetInfo > xInfo = pImpl->m_xPathSettings->getPropertySetInfo(); + Property aProp = xInfo->getPropertyByName( sProp ); + _rReadOnly = ( ( aProp.Attributes & PropertyAttribute::READONLY ) == PropertyAttribute::READONLY ); } catch( const Exception& ) { @@ -790,36 +786,32 @@ void SvxPathTabPage::SetPathList( { String sCfgName = getCfgName_Impl( _nPathHandle ); - // load PathSettings service if necessary - if ( !pImpl->m_xPathSettings.is() ) - { - Reference< XMultiServiceFactory > xSMgr = comphelper::getProcessServiceFactory(); - pImpl->m_xPathSettings = Reference< XPropertySet >( xSMgr->createInstance( - "com.sun.star.util.PathSettings" ), UNO_QUERY ); - } - try { - if ( pImpl->m_xPathSettings.is() ) + // load PathSettings service if necessary + if ( !pImpl->m_xPathSettings.is() ) { - // save user paths - char cDelim = MULTIPATH_DELIMITER; - sal_uInt16 nCount = comphelper::string::getTokenCount(_rUserPath, cDelim); - Sequence< OUString > aPathSeq( nCount ); - OUString* pArray = aPathSeq.getArray(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) - pArray[i] = OUString( _rUserPath.GetToken( i, cDelim ) ); - String sProp( sCfgName ); - sProp += POSTFIX_USER; - Any aValue = makeAny( aPathSeq ); - pImpl->m_xPathSettings->setPropertyValue( sProp, aValue ); - - // then the writable path - aValue = makeAny( OUString( _rWritablePath ) ); - sProp = sCfgName; - sProp += POSTFIX_WRITABLE; - pImpl->m_xPathSettings->setPropertyValue( sProp, aValue ); + Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + pImpl->m_xPathSettings = css::util::PathSettings::create( xContext ); } + + // save user paths + char cDelim = MULTIPATH_DELIMITER; + sal_uInt16 nCount = comphelper::string::getTokenCount(_rUserPath, cDelim); + Sequence< OUString > aPathSeq( nCount ); + OUString* pArray = aPathSeq.getArray(); + for ( sal_uInt16 i = 0; i < nCount; ++i ) + pArray[i] = OUString( _rUserPath.GetToken( i, cDelim ) ); + String sProp( sCfgName ); + sProp += POSTFIX_USER; + Any aValue = makeAny( aPathSeq ); + pImpl->m_xPathSettings->setPropertyValue( sProp, aValue ); + + // then the writable path + aValue = makeAny( OUString( _rWritablePath ) ); + sProp = sCfgName; + sProp += POSTFIX_WRITABLE; + pImpl->m_xPathSettings->setPropertyValue( sProp, aValue ); } catch( const Exception& e ) { diff --git a/framework/inc/services.h b/framework/inc/services.h index bf1502632bea..b77c0a680be0 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -37,7 +37,6 @@ namespace framework{ #define SERVICENAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.frame.ContentHandlerFactory" ) #define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" ) #define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" ) -#define SERVICENAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.util.PathSettings" ) #define SERVICENAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.frame.LayoutManager" ) #define SERVICENAME_POPUPMENUCONTROLLER DECLARE_ASCII("com.sun.star.frame.PopupMenuController" ) #define SERVICENAME_MODULEUICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManager" ) @@ -75,7 +74,6 @@ namespace framework{ #define IMPLEMENTATIONNAME_MAILTODISPATCHER DECLARE_ASCII("com.sun.star.comp.framework.MailToDispatcher" ) #define IMPLEMENTATIONNAME_SERVICEHANDLER DECLARE_ASCII("com.sun.star.comp.framework.ServiceHandler" ) #define IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES DECLARE_ASCII("com.sun.star.comp.framework.PathSubstitution" ) -#define IMPLEMENTATIONNAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.comp.framework.PathSettings" ) #define IMPLEMENTATIONNAME_JOBDISPATCH DECLARE_ASCII("com.sun.star.comp.framework.jobs.JobDispatch" ) #define IMPLEMENTATIONNAME_DISPATCHHELPER DECLARE_ASCII("com.sun.star.comp.framework.services.DispatchHelper" ) #define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" ) diff --git a/framework/inc/services/pathsettings.hxx b/framework/inc/services/pathsettings.hxx index 4dffe13a91ae..799e2fac7571 100644 --- a/framework/inc/services/pathsettings.hxx +++ b/framework/inc/services/pathsettings.hxx @@ -28,11 +28,12 @@ #include <stdtypes.h> #include <properties.h> +#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/util/XChangesListener.hpp> -#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/util/XPathSettings.hpp> #include <cppuhelper/propshlp.hxx> #include <cppuhelper/interfacecontainer.hxx> @@ -50,6 +51,7 @@ namespace framework class PathSettings : public css::lang::XTypeProvider , public css::lang::XServiceInfo , public css::util::XChangesListener , // => XEventListener + public css::util::XPathSettings , // => XPropertySet // base classes // Order is necessary for right initialization! private ThreadHelpBase , @@ -173,11 +175,151 @@ class PathSettings : public css::lang::XTypeProvider , using ::cppu::OPropertySetHelper::disposing; + + /** + * XPathSettings attribute methods + */ + virtual OUString SAL_CALL getAddin() throw (css::uno::RuntimeException) + { return getStringProperty("Addin"); } + virtual void SAL_CALL setAddin(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Addin", p1); } + virtual OUString getAutoCorrect() throw (css::uno::RuntimeException) + { return getStringProperty("AutoCorrect"); } + virtual void SAL_CALL setAutoCorrect(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("AutoCorrect", p1); } + virtual OUString SAL_CALL getAutoText() throw (css::uno::RuntimeException) + { return getStringProperty("AutoText"); } + virtual void SAL_CALL setAutoText(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("AutoText", p1); } + virtual OUString SAL_CALL getBackup() throw (css::uno::RuntimeException) + { return getStringProperty("Backup"); } + virtual void SAL_CALL setBackup(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Backup", p1); } + virtual OUString SAL_CALL getBasic() throw (css::uno::RuntimeException) + { return getStringProperty("Basic"); } + virtual void SAL_CALL setBasic(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Basic", p1); } + virtual OUString SAL_CALL getBitmap() throw (css::uno::RuntimeException) + { return getStringProperty("Bitmap"); } + virtual void SAL_CALL setBitmap(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Bitmap", p1); } + virtual OUString SAL_CALL getConfig() throw (css::uno::RuntimeException) + { return getStringProperty("Config"); } + virtual void SAL_CALL setConfig(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Config", p1); } + virtual OUString SAL_CALL getDictionary() throw (css::uno::RuntimeException) + { return getStringProperty("Dictionary"); } + virtual void SAL_CALL setDictionary(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Dictionary", p1); } + virtual OUString SAL_CALL getFavorite() throw (css::uno::RuntimeException) + { return getStringProperty("Favorite"); } + virtual void SAL_CALL setFavorite(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Favorite", p1); } + virtual OUString SAL_CALL getFilter() throw (css::uno::RuntimeException) + { return getStringProperty("Filter"); } + virtual void SAL_CALL setFilter(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Filter", p1); } + virtual OUString SAL_CALL getGallery() throw (css::uno::RuntimeException) + { return getStringProperty("Gallery"); } + virtual void SAL_CALL setGallery(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Gallery", p1); } + virtual OUString SAL_CALL getGraphic() throw (css::uno::RuntimeException) + { return getStringProperty("Graphic"); } + virtual void SAL_CALL setGraphic(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Graphic", p1); } + virtual OUString SAL_CALL getHelp() throw (css::uno::RuntimeException) + { return getStringProperty("Help"); } + virtual void SAL_CALL setHelp(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Help", p1); } + virtual OUString SAL_CALL getLinguistic() throw (css::uno::RuntimeException) + { return getStringProperty("Linguistic"); } + virtual void SAL_CALL setLinguistic(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Linguistic", p1); } + virtual OUString SAL_CALL getModule() throw (css::uno::RuntimeException) + { return getStringProperty("Module"); } + virtual void SAL_CALL setModule(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Module", p1); } + virtual OUString SAL_CALL getPalette() throw (css::uno::RuntimeException) + { return getStringProperty("Palette"); } + virtual void SAL_CALL setPalette(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Palette", p1); } + virtual OUString SAL_CALL getPlugin() throw (css::uno::RuntimeException) + { return getStringProperty("Plugin"); } + virtual void SAL_CALL setPlugin(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Plugin", p1); } + virtual OUString SAL_CALL getStorage() throw (css::uno::RuntimeException) + { return getStringProperty("Storage"); } + virtual void SAL_CALL setStorage(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Storage", p1); } + virtual OUString SAL_CALL getTemp() throw (css::uno::RuntimeException) + { return getStringProperty("Temp"); } + virtual void SAL_CALL setTemp(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Temp", p1); } + virtual OUString SAL_CALL getTemplate() throw (css::uno::RuntimeException) + { return getStringProperty("Template"); } + virtual void SAL_CALL setTemplate(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Template", p1); } + virtual OUString SAL_CALL getUIConfig() throw (css::uno::RuntimeException) + { return getStringProperty("UIConfig"); } + virtual void SAL_CALL setUIConfig(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("UIConfig", p1); } + virtual OUString SAL_CALL getUserConfig() throw (css::uno::RuntimeException) + { return getStringProperty("UserConfig"); } + virtual void SAL_CALL setUserConfig(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("UserConfig", p1); } + virtual OUString SAL_CALL getUserDictionary() throw (css::uno::RuntimeException) + { return getStringProperty("UserDictionary"); } + virtual void SAL_CALL setUserDictionary(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("UserDictionary", p1); } + virtual OUString SAL_CALL getWork() throw (css::uno::RuntimeException) + { return getStringProperty("Work"); } + virtual void SAL_CALL setWork(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("Work", p1); } + virtual OUString SAL_CALL getBasePathShareLayer() throw (css::uno::RuntimeException) + { return getStringProperty("UIConfig"); } + virtual void SAL_CALL setBasePathShareLayer(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("UIConfig", p1); } + virtual OUString SAL_CALL getBasePathUserLayer() throw (css::uno::RuntimeException) + { return getStringProperty("UserConfig"); } + virtual void SAL_CALL setBasePathUserLayer(const OUString& p1) throw (css::uno::RuntimeException) + { setStringProperty("UserConfig", p1); } + + + + /** + * overrides to resolve inheritance ambiguity + */ + virtual void SAL_CALL setPropertyValue(const OUString& p1, const css::uno::Any& p2) + throw (css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException) + { ::cppu::OPropertySetHelper::setPropertyValue(p1, p2); } + virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& p1) + throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException) + { return ::cppu::OPropertySetHelper::getPropertyValue(p1); } + virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) + throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException) + { ::cppu::OPropertySetHelper::addPropertyChangeListener(p1, p2); } + virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) + throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException) + { ::cppu::OPropertySetHelper::removePropertyChangeListener(p1, p2); } + virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) + throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException) + { ::cppu::OPropertySetHelper::addVetoableChangeListener(p1, p2); } + virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) + throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException) + { ::cppu::OPropertySetHelper::removeVetoableChangeListener(p1, p2); } + + // ___________________________________________ // helper private: + OUString getStringProperty(const OUString& p1) + throw(css::uno::RuntimeException); + + void setStringProperty(const OUString& p1, const OUString& p2) + throw(css::uno::RuntimeException); + /** read all configured paths and create all needed internal structures. */ void impl_readAll(); @@ -264,7 +406,7 @@ class PathSettings : public css::lang::XTypeProvider , virtual void SAL_CALL getFastPropertyValue ( css::uno::Any& aValue , sal_Int32 nHandle ) const; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper ( ); - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo ( ) throw(::com::sun::star::uno::RuntimeException); + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo ( ) throw(::css::uno::RuntimeException); /** factory methods to guarantee right (but on demand) initialized members ... */ css::uno::Reference< css::util::XStringSubstitution > fa_getSubstitution(); diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index 0ba15b8bde76..6cc93c36efec 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -26,14 +26,15 @@ #include <threadhelp/writeguard.hxx> #include <services.h> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/configuration/CorruptedUIConfigurationException.hpp> #include <com/sun/star/container/NoSuchElementException.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/FileSystemStorageFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include <vcl/svapp.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -44,9 +45,6 @@ #define SUBSTORAGE_GLOBAL DECLARE_ASCII("global" ) #define SUBSTORAGE_MODULES DECLARE_ASCII("modules") -#define BASEPATH_SHARE_LAYER DECLARE_ASCII("UIConfig" ) -#define BASEPATH_USER_LAYER DECLARE_ASCII("UserConfig") - #define RELPATH_SHARE_LAYER DECLARE_ASCII("soffice.cfg") #define RELPATH_USER_LAYER DECLARE_ASCII("soffice.cfg") @@ -228,12 +226,10 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::beans::XPropertySet > xPathSettings( - xSMGR->createInstance(SERVICENAME_PATHSETTINGS), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::util::XPathSettings > xPathSettings = + css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) ); - OUString sShareLayer; - xPathSettings->getPropertyValue(BASEPATH_SHARE_LAYER) >>= sShareLayer; + OUString sShareLayer = xPathSettings->getBasePathShareLayer(); // "UIConfig" is a "multi path" ... use first part only here! sal_Int32 nPos = sShareLayer.indexOf(';'); @@ -288,12 +284,10 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag aReadLock.unlock(); // <- SAFE ---------------------------------- - css::uno::Reference< css::beans::XPropertySet > xPathSettings( - xSMGR->createInstance(SERVICENAME_PATHSETTINGS), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::util::XPathSettings > xPathSettings = + css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) ); - OUString sUserLayer; - xPathSettings->getPropertyValue(BASEPATH_USER_LAYER) >>= sUserLayer ; + OUString sUserLayer = xPathSettings->getBasePathUserLayer(); // Note: May be an user uses URLs without a final slash! Check it ... sal_Int32 nPos = sUserLayer.lastIndexOf('/'); diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index 1369950ae942..4734eb2eb27a 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -74,29 +74,34 @@ sal_Int32 impl_getPropGroup(sal_Int32 nID) } +#define SERVICENAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.util.PathSettings" ) +#define IMPLEMENTATIONNAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.comp.framework.PathSettings" ) + namespace framework { //----------------------------------------------------------------------------- // XInterface, XTypeProvider, XServiceInfo -DEFINE_XINTERFACE_7 ( PathSettings , +DEFINE_XINTERFACE_8 ( PathSettings , OWeakObject , DIRECT_INTERFACE ( css::lang::XTypeProvider ), DIRECT_INTERFACE ( css::lang::XServiceInfo ), DERIVED_INTERFACE( css::lang::XEventListener, css::util::XChangesListener), DIRECT_INTERFACE ( css::util::XChangesListener ), - DIRECT_INTERFACE ( css::beans::XPropertySet ), + DIRECT_INTERFACE ( css::util::XPathSettings ), + DERIVED_INTERFACE( css::beans::XPropertySet, css::util::XPathSettings), DIRECT_INTERFACE ( css::beans::XFastPropertySet ), DIRECT_INTERFACE ( css::beans::XMultiPropertySet ) ) -DEFINE_XTYPEPROVIDER_7 ( PathSettings , +DEFINE_XTYPEPROVIDER_8 ( PathSettings , css::lang::XTypeProvider , css::lang::XServiceInfo , css::lang::XEventListener , css::util::XChangesListener , - css::beans::XPropertySet , + css::util::XPathSettings , + css::beans::XPropertySet , css::beans::XFastPropertySet , css::beans::XMultiPropertySet ) @@ -195,6 +200,23 @@ void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource) } //----------------------------------------------------------------------------- +OUString PathSettings::getStringProperty(const OUString& p1) + throw(css::uno::RuntimeException) +{ + css::uno::Any a = ::cppu::OPropertySetHelper::getPropertyValue(p1); + OUString s; + a >>= s; + return s; +} + +//----------------------------------------------------------------------------- +void PathSettings::setStringProperty(const OUString& p1, const OUString& p2) + throw(css::uno::RuntimeException) +{ + ::cppu::OPropertySetHelper::setPropertyValue(p1, css::uno::Any(p2)); +} + +//----------------------------------------------------------------------------- void PathSettings::impl_readAll() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readAll" ); @@ -1124,6 +1146,8 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew() ReadGuard aReadLock(m_aLock); css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; css::uno::Reference< css::container::XNameAccess > xCfg = m_xCfgNew; + if (xCfg.is()) + return xCfg; aReadLock.unlock(); // <- SAFE diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index de5ac2442b34..d3ed5504a06a 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -28,10 +28,10 @@ #include <unotools/ucbhelper.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> - #include <com/sun/star/beans/PropertyValues.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Reference.h> +#include <com/sun/star/util/PathSettings.hpp> #include "linguistic/misc.hxx" @@ -70,28 +70,25 @@ static uno::Sequence< OUString > GetMultiPaths_Impl( OUString aWritablePath; bool bSuccess = true; - uno::Reference< lang::XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() ); - if (xMgr.is()) + uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + try { - try - { - String aInternal( rPathPrefix ); - String aUser( rPathPrefix ); - String aWriteable( rPathPrefix ); - aInternal .AppendAscii( "_internal" ); - aUser .AppendAscii( "_user" ); - aWriteable.AppendAscii( "_writable" ); - - uno::Reference< beans::XPropertySet > xPathSettings( xMgr->createInstance( - "com.sun.star.util.PathSettings" ), uno::UNO_QUERY_THROW ); - xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths; - xPathSettings->getPropertyValue( aUser ) >>= aUserPaths; - xPathSettings->getPropertyValue( aWriteable ) >>= aWritablePath; - } - catch (uno::Exception &) - { - bSuccess = false; - } + String aInternal( rPathPrefix ); + String aUser( rPathPrefix ); + String aWriteable( rPathPrefix ); + aInternal .AppendAscii( "_internal" ); + aUser .AppendAscii( "_user" ); + aWriteable.AppendAscii( "_writable" ); + + uno::Reference< util::XPathSettings > xPathSettings = + util::PathSettings::create( xContext ); + xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths; + xPathSettings->getPropertyValue( aUser ) >>= aUserPaths; + xPathSettings->getPropertyValue( aWriteable ) >>= aWritablePath; + } + catch (uno::Exception &) + { + bSuccess = false; } if (bSuccess) { diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 8022e5ebf522..56c4f4add6b6 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -405,6 +405,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\ NumberFormatter \ NumberFormatsSupplier \ PathSubstitution \ + PathSettings \ TextSearch \ theOfficeInstallationDirectories \ UriAbbreviation \ @@ -1528,7 +1529,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/util,\ NumberFormatSettings \ NumberFormats \ OfficeInstallationDirectories \ - PathSettings \ ReplaceDescriptor \ SearchDescriptor \ SortDescriptor \ @@ -4061,6 +4061,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/util,\ XNumberFormatter \ XNumberFormatter2 \ XOfficeInstallationDirectories \ + XPathSettings \ XPropertyReplace \ XProtectable \ XRefreshListener \ diff --git a/offapi/com/sun/star/util/PathSettings.idl b/offapi/com/sun/star/util/PathSettings.idl index 4523f1628ed0..b43bba6eebb1 100644 --- a/offapi/com/sun/star/util/PathSettings.idl +++ b/offapi/com/sun/star/util/PathSettings.idl @@ -20,9 +20,7 @@ #ifndef __com_sun_star_util_PathSettings_idl__ #define __com_sun_star_util_PathSettings_idl__ -#include <com/sun/star/beans/XPropertySet.idl> -#include <com/sun/star/beans/XFastPropertySet.idl> -#include <com/sun/star/beans/XMultiPropertySet.idl> +#include <com/sun/star/util/XPathSettings.idl> module com { module sun { module star { module util { @@ -41,112 +39,7 @@ module com { module sun { module star { module util { @since OOo 1.1.2 */ -published service PathSettings -{ - /** Main interface to have access to the path properties. */ - interface com::sun::star::beans::XPropertySet; - - /** An extension to the <type scope="com::sun::star::beans">XPropertySet</type> interface. - The get and set methods use handles to access the property values - instead of character strings. */ - interface com::sun::star::beans::XFastPropertySet; - - /** Provides access to multiple properties of this service with a - single call. */ - interface com::sun::star::beans::XMultiPropertySet; - - /** Specifies the directory that contains spreadsheet add-ins which use - the old add-in API */ - [property] string Addin; - - /** The settings of the AutoCorrect dialog. The value can be more than - one path separated by a semicolon. - */ - [property] string AutoCorrect; - - /**The directory which contains the AutoText modules. The value can be more than - one path separated by a semicolon.*/ - [property] string AutoText; - - /** Automatic backup copies of documents are stored here. */ - [property] string Backup; - - /** The Basic files, used by the AutoPilots, can be found here. The value can be more than - one path separated by a semicolon.*/ - [property] string Basic; - - /** This directory contains the icons for the toolbars. */ - [property] string Bitmap; - - /** The configuration files are located here. This entry cannot be changed - by the user in Office user interface. */ - [property] string Config; - - /** The provided dictionaries are stored here. */ - [property] string Dictionary; - - /** Path to save folder bookmarks */ - [property] string Favorite; - - /** Specifies the directory where all the filters are stored. */ - [property] string Filter; - - /** Specifies the directories which contains the Gallery - database and multimedia files. The value can be more than - one path separated by a semicolon.*/ - [property] string Gallery; - - /** This directory is displayed when the dialog for opening a graphic - or for saving a new graphic is called. */ - [property] string Graphic; - - /** The path to the Office help files. */ - [property] string Help; - - /** The files that are necessary for the spell check are saved here. */ - [property] string Linguistic; - - /** This is the path for the modules. */ - [property] string Module; - - /** This is the path to the palette files *.SOB to *.SOF containing - user-defined colors and patterns. */ - [property] string Palette; - - /** Plugins are saved in these directories. The value can be more than - one path separated by a semicolon.*/ - [property] string Plugin; - - /** Mail, News files and other information (for example, about FTP Server) - are stored here.*/ - [property] string Storage; - - /** The base url to the office temp-files */ - [property] string Temp; - - /** The templates originate from these folders and sub-folders. The value - can be more than one path separated by a semicolon.*/ - [property] string Template; - - /** Global directories to look for user interface configuration files. The - user interface configuration will be merged with user settings stored - in the directory specified by <var>UserConfig</var>. The value can be more - than one path separated by a semicolon.*/ - [property] string UIConfig; - - /** Specifies the folder with the user settings. */ - [property] string UserConfig; - - /** The custom dictionaries are contained here. - * @deprecated - * */ - [property] string UserDictionary; - - /** The path of the work folder can be modified according to the - user's needs. The path specified here can be seen in the Open - or Save dialog. */ - [property] string Work; -}; +published service PathSettings : XPathSettings; }; }; }; }; diff --git a/offapi/com/sun/star/util/XPathSettings.idl b/offapi/com/sun/star/util/XPathSettings.idl new file mode 100644 index 000000000000..5f202a369dd6 --- /dev/null +++ b/offapi/com/sun/star/util/XPathSettings.idl @@ -0,0 +1,138 @@ +/* -*- 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_util_XPathSettings_idl__ +#define __com_sun_star_util_XPathSettings_idl__ + +#include <com/sun/star/beans/XPropertySet.idl> + + +module com { module sun { module star { module util { + + +/** + @since LibreOffice 4.1 + */ +published interface XPathSettings +{ + /** Main interface to have access to the path properties. */ + interface com::sun::star::beans::XPropertySet; + + /** Specifies the directory that contains spreadsheet add-ins which use + the old add-in API */ + [attribute] string Addin; + + /** The settings of the AutoCorrect dialog. The value can be more than + one path separated by a semicolon. + */ + [attribute] string AutoCorrect; + + /**The directory which contains the AutoText modules. The value can be more than + one path separated by a semicolon.*/ + [attribute] string AutoText; + + /** Automatic backup copies of documents are stored here. */ + [attribute] string Backup; + + /** The Basic files, used by the AutoPilots, can be found here. The value can be more than + one path separated by a semicolon.*/ + [attribute] string Basic; + + /** This directory contains the icons for the toolbars. */ + [attribute] string Bitmap; + + /** The configuration files are located here. This entry cannot be changed + by the user in Office user interface. */ + [attribute] string Config; + + /** The provided dictionaries are stored here. */ + [attribute] string Dictionary; + + /** Path to save folder bookmarks */ + [attribute] string Favorite; + + /** Specifies the directory where all the filters are stored. */ + [attribute] string Filter; + + /** Specifies the directories which contains the Gallery + database and multimedia files. The value can be more than + one path separated by a semicolon.*/ + [attribute] string Gallery; + + /** This directory is displayed when the dialog for opening a graphic + or for saving a new graphic is called. */ + [attribute] string Graphic; + + /** The path to the Office help files. */ + [attribute] string Help; + + /** The files that are necessary for the spell check are saved here. */ + [attribute] string Linguistic; + + /** This is the path for the modules. */ + [attribute] string Module; + + /** This is the path to the palette files *.SOB to *.SOF containing + user-defined colors and patterns. */ + [attribute] string Palette; + + /** Plugins are saved in these directories. The value can be more than + one path separated by a semicolon.*/ + [attribute] string Plugin; + + /** Mail, News files and other information (for example, about FTP Server) + are stored here.*/ + [attribute] string Storage; + + /** The base url to the office temp-files */ + [attribute] string Temp; + + /** The templates originate from these folders and sub-folders. The value + can be more than one path separated by a semicolon.*/ + [attribute] string Template; + + /** Global directories to look for user interface configuration files. The + user interface configuration will be merged with user settings stored + in the directory specified by <var>UserConfig</var>. The value can be more + than one path separated by a semicolon.*/ + [attribute] string UIConfig; + + /** Specifies the folder with the user settings. */ + [attribute] string UserConfig; + + /** The custom dictionaries are contained here. + * @deprecated + * */ + [attribute] string UserDictionary; + + /** The path of the work folder can be modified according to the + user's needs. The path specified here can be seen in the Open + or Save dialog. */ + [attribute] string Work; + + [attribute] string BasePathShareLayer; + [attribute] string BasePathUserLayer; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb Binary files differindex d72a454c845d..2aa5361ff528 100644 --- a/offapi/type_reference/offapi.rdb +++ b/offapi/type_reference/offapi.rdb diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 958a5bb0f6ff..f13d801599ae 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -19,21 +19,23 @@ #include <stdio.h> -#include <com/sun/star/sheet/XSpreadsheetView.hpp> -#include <com/sun/star/sheet/XSpreadsheets.hpp> -#include <com/sun/star/view/XSelectionSupplier.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <ooo/vba/excel/XlCalculation.hpp> -#include <com/sun/star/sheet/XCellRangeReferrer.hpp> -#include <com/sun/star/sheet/XCalculatable.hpp> +#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/sheet/XCalculatable.hpp> +#include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/sheet/XCellRangeReferrer.hpp> +#include <com/sun/star/sheet/XNamedRanges.hpp> +#include <com/sun/star/sheet/XSpreadsheetView.hpp> +#include <com/sun/star/sheet/XSpreadsheets.hpp> #include <com/sun/star/task/XStatusIndicatorSupplier.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> -#include <ooo/vba/excel/XlMousePointer.hpp> -#include <com/sun/star/sheet/XNamedRanges.hpp> -#include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/util/PathSettings.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include <ooo/vba/XExecutableDialog.hpp> +#include <ooo/vba/excel/XlCalculation.hpp> +#include <ooo/vba/excel/XlMousePointer.hpp> #include "vbaapplication.hxx" #include "vbaworkbooks.hxx" @@ -879,20 +881,19 @@ ScVbaApplication::Calculate() throw( script::BasicErrorException , uno::Runtime xCalculatable->calculateAll(); } -static uno::Reference< beans::XPropertySet > lcl_getPathSettingsService( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) +static uno::Reference< util::XPathSettings > lcl_getPathSettingsService( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) { - static uno::Reference< beans::XPropertySet > xPathSettings; + static uno::Reference< util::XPathSettings > xPathSettings; if ( !xPathSettings.is() ) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - xPathSettings.set( xSMgr->createInstanceWithContext( OUString("com.sun.star.util.PathSettings"), xContext ), uno::UNO_QUERY_THROW ); + xPathSettings.set( util::PathSettings::create( xContext ) ); } return xPathSettings; } OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) throw ( uno::RuntimeException ) { OUString sRetPath; - uno::Reference< beans::XPropertySet > xProps = lcl_getPathSettingsService( mxContext ); + uno::Reference< util::XPathSettings > xProps = lcl_getPathSettingsService( mxContext ); try { OUString sUrl; @@ -914,10 +915,10 @@ OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) throw ( u void SAL_CALL ScVbaApplication::setDefaultFilePath( const OUString& DefaultFilePath ) throw (uno::RuntimeException) { - uno::Reference< beans::XPropertySet > xProps = lcl_getPathSettingsService( mxContext ); + uno::Reference< util::XPathSettings > xProps = lcl_getPathSettingsService( mxContext ); OUString aURL; osl::FileBase::getFileURLFromSystemPath( DefaultFilePath, aURL ); - xProps->setPropertyValue( OUString("Work"), uno::Any( aURL ) ); + xProps->setWork( aURL ); } OUString SAL_CALL diff --git a/sw/source/ui/vba/vbaoptions.cxx b/sw/source/ui/vba/vbaoptions.cxx index 0c21ae0fca93..bdbcfb2d5812 100644 --- a/sw/source/ui/vba/vbaoptions.cxx +++ b/sw/source/ui/vba/vbaoptions.cxx @@ -22,16 +22,16 @@ #include <ooo/vba/word/WdLineStyle.hpp> #include <ooo/vba/word/WdLineWidth.hpp> #include <ooo/vba/word/WdColorIndex.hpp> -#include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/XStringSubstitution.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include <osl/file.hxx> using namespace ::ooo::vba; using namespace ::com::sun::star; -SwVbaOptions::SwVbaOptions( uno::Reference<uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) : SwVbaOptions_BASE( uno::Reference< XHelperInterface >(), xContext ) +SwVbaOptions::SwVbaOptions( uno::Reference<uno::XComponentContext >& xContext ) : SwVbaOptions_BASE( uno::Reference< XHelperInterface >(), xContext ) { - mxFactory.set( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); } SwVbaOptions::~SwVbaOptions() @@ -95,7 +95,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value ) value >>= sNewPath; OUString sNewPathUrl; ::osl::File::getFileURLFromSystemPath( sNewPath, sNewPathUrl ); - uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( OUString("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW ); + uno::Reference< util::XPathSettings > xPathSettings = util::PathSettings::create( comphelper::getProcessComponentContext() ); OUString sOldPathUrl; xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sOldPathUrl; // path could be a multipath, Microsoft doesn't support this feature in Word currently @@ -110,7 +110,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value ) uno::Any SwVbaOptions::getValueEvent() { - uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( OUString("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW ); + uno::Reference< util::XPathSettings > xPathSettings = util::PathSettings::create( comphelper::getProcessComponentContext() ); OUString sPathUrl; xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sPathUrl; // path could be a multipath, Microsoft doesn't support this feature in Word currently diff --git a/sw/source/ui/vba/vbaoptions.hxx b/sw/source/ui/vba/vbaoptions.hxx index dbd89e4aaf23..2a2573e8ce5d 100644 --- a/sw/source/ui/vba/vbaoptions.hxx +++ b/sw/source/ui/vba/vbaoptions.hxx @@ -32,9 +32,8 @@ class SwVbaOptions : public SwVbaOptions_BASE, { private: OUString msDefaultFilePath; - css::uno::Reference< css::lang::XMultiServiceFactory > mxFactory; public: - SwVbaOptions( css::uno::Reference< css::uno::XComponentContext >& m_xContext ) throw ( css::uno::RuntimeException ); + SwVbaOptions( css::uno::Reference< css::uno::XComponentContext >& m_xContext ); virtual ~SwVbaOptions(); // Attributes diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index c55072f136e9..8c39f291bd24 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -35,9 +35,10 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include <com/sun/star/util/PathSubstitution.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/theMacroExpander.hpp> #include <rtl/instance.hxx> @@ -417,24 +418,13 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); // Create necessary services - m_xPathSettings = Reference< XFastPropertySet >( xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.util.PathSettings", xContext), - UNO_QUERY ); - if ( !m_xPathSettings.is() ) - { - // #112719#: check for existance - OSL_FAIL( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" ); - throw RuntimeException( - OUString( "Service com.sun.star.util.PathSettings cannot be created" ), - Reference< XInterface >() ); - } - + Reference< XPathSettings > xPathSettings = PathSettings::create(xContext); + m_xPathSettings.set( xPathSettings, UNO_QUERY_THROW ); m_xSubstVariables.set( PathSubstitution::create(xContext) ); m_xMacroExpander = theMacroExpander::get(xContext); // Create temporary hash map to have a mapping between property names and property handles - Reference< XPropertySet > xPropertySet = Reference< XPropertySet >( m_xPathSettings, UNO_QUERY ); - Reference< XPropertySetInfo > xPropSetInfo = xPropertySet->getPropertySetInfo(); + Reference< XPropertySetInfo > xPropSetInfo = xPathSettings->getPropertySetInfo(); Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties(); NameToHandleMap aTempHashMap; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 4ea01eb635e5..c0bb50162f9f 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/util/PathSettings.hpp> #include <comphelper/processfactory.hxx> #include <osl/file.hxx> @@ -477,19 +478,15 @@ Dialog::Dialog( WindowType nType ) ImplInitDialogData(); } -#define BASEPATH_SHARE_LAYER OUString("UIConfig") #define RELPATH_SHARE_LAYER OUString("soffice.cfg") -#define SERVICENAME_PATHSETTINGS OUString("com.sun.star.util.PathSettings") OUString VclBuilderContainer::getUIRootDir() { /*to-do, check if user config has an override before using shared one, etc*/ - css::uno::Reference< css::beans::XPropertySet > xPathSettings( - ::comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_PATHSETTINGS), - css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::util::XPathSettings > xPathSettings = css::util::PathSettings::create( + ::comphelper::getProcessComponentContext() ); - OUString sShareLayer; - xPathSettings->getPropertyValue(BASEPATH_SHARE_LAYER) >>= sShareLayer; + OUString sShareLayer = xPathSettings->getBasePathShareLayer(); // "UIConfig" is a "multi path" ... use first part only here! sal_Int32 nPos = sShareLayer.indexOf(';'); |