diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-04 09:12:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-09 08:08:14 +0200 |
commit | fd5a2eb07011e8aedfd5ef0a82edaf07221554ba (patch) | |
tree | cae1b578b1f5a3faea88499274c23303401a9439 /unotools | |
parent | 3a50e97499d0c1ff6307dcfe9883aea1af300947 (diff) |
fdo#46808, new method OConfigurationTreeRoot::createWithComponentContext
and use it to replace usage of createWithServiceFactory, and thus
replace usage of XMultiServiceFactory.
Change-Id: Id2f44066683ce17cf7a22f80916031556ef0e82a
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/confignode.hxx | 15 | ||||
-rw-r--r-- | unotools/source/config/confignode.cxx | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx index beb02ec2f2fe..51ce1e05c904 100644 --- a/unotools/inc/unotools/confignode.hxx +++ b/unotools/inc/unotools/confignode.hxx @@ -296,6 +296,21 @@ namespace utl static OConfigurationTreeRoot createWithServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True); + /** open a new top-level configuration node<p/> + opens a new node which is the root if an own configuration sub tree. This is what "top level" means: The + node does not have a parent. It does not mean that the node represents a module tree (like org.openoffice.Office.Writer + or such).<br/> + In opposite to <method>createWithProvider</method>, createWithProvider expects a service factory. This factory + is used to create a configuration provider, and this provider is used to retrieve the node + @see createWithProvider + @param _rxContext service factory to use to create the configuration provider. + @param _rPath path to the node the object should represent + @param _nDepth depth for node retrieval + @param _eMode specifies which privileges should be applied when retrieving the node + */ + static OConfigurationTreeRoot createWithComponentContext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, + const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True); + /** tolerant version of the <member>createWithServiceFactory</member> <p>No assertions are thrown in case of an failure to initialize the configuration service, but once diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index 859e8df0e031..6d118d2d1910 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -592,6 +592,12 @@ namespace utl } //------------------------------------------------------------------------ + OConfigurationTreeRoot OConfigurationTreeRoot::createWithComponentContext( const Reference< XComponentContext >& _rxContext, const ::rtl::OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode, sal_Bool _bLazyWrite ) + { + return createWithProvider( lcl_getConfigProvider( _rxContext ), _rPath, _nDepth, _eMode, _bLazyWrite ); + } + + //------------------------------------------------------------------------ OConfigurationTreeRoot OConfigurationTreeRoot::tryCreateWithComponentContext( const Reference< XComponentContext >& rxContext, const ::rtl::OUString& _rPath, sal_Int32 _nDepth , CREATION_MODE _eMode , sal_Bool _bLazyWrite ) { |