summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx5
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx19
-rw-r--r--xmlhelp/source/treeview/tvread.cxx24
-rw-r--r--xmlhelp/source/treeview/tvread.hxx4
4 files changed, 22 insertions, 30 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index fb84af33f690..5113638f002a 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/beans/Optional.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
@@ -252,8 +253,8 @@ rtl::OString Databases::getImagesZipFileURL()
sal_Int16 nSymbolsStyle = 0;
try
{
- uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
- m_xSMgr ->createInstanceWithContext(::rtl::OUString("com.sun.star.configuration.ConfigurationProvider"), m_xContext), uno::UNO_QUERY_THROW);
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider =
+ configuration::theDefaultProvider::get(m_xContext);
// set root path
uno::Sequence < uno::Any > lParams(1);
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index e3deabafd57e..6272306e1b11 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -306,8 +307,8 @@ void ContentProvider::init()
try
{
- uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
- m_xSMgr ->createInstance(::rtl::OUString("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY_THROW);
+ uno::Reference< lang::XMultiServiceFactory > xConfigProvider =
+ configuration::theDefaultProvider::get( comphelper::getComponentContext(m_xSMgr) );
uno::Sequence < uno::Any > lParams(1);
beans::PropertyValue aParam ;
@@ -361,26 +362,20 @@ void ContentProvider::init()
uno::Reference< lang::XMultiServiceFactory >
ContentProvider::getConfiguration() const
{
- uno::Reference< lang::XMultiServiceFactory > sProvider;
+ uno::Reference< lang::XMultiServiceFactory > xProvider;
if( m_xSMgr.is() )
{
try
{
- rtl::OUString sProviderService =
- rtl::OUString(
- "com.sun.star.configuration.ConfigurationProvider" );
- sProvider =
- uno::Reference< lang::XMultiServiceFactory >(
- m_xSMgr->createInstance( sProviderService ),
- uno::UNO_QUERY );
+ xProvider = configuration::theDefaultProvider::get( comphelper::getComponentContext(m_xSMgr) );
}
catch( const uno::Exception& )
{
- OSL_ENSURE( sProvider.is(), "cant instantiate configuration" );
+ OSL_ENSURE( xProvider.is(), "cant instantiate configuration" );
}
}
- return sProvider;
+ return xProvider;
}
uno::Reference< container::XHierarchicalNameAccess >
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 52d1e4abacc5..e4b4b948404f 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -33,6 +33,7 @@
#include <expat.h>
#include <osl/file.hxx>
#include <unotools/configmgr.hxx>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -182,6 +183,7 @@ using namespace treeview;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
+using namespace com::sun::star::configuration;
using namespace com::sun::star::lang;
using namespace com::sun::star::util;
using namespace com::sun::star::frame;
@@ -720,7 +722,7 @@ TVChildTarget::hasByHierarchicalName( const rtl::OUString& aName )
ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
{
ConfigData configData;
- Reference< XMultiServiceFactory > sProvider( getConfiguration(xSMgr) );
+ Reference< XMultiServiceFactory > sProvider( getConfiguration(comphelper::getComponentContext(xSMgr)) );
/**********************************************************************/
/* reading Office.Common */
@@ -750,8 +752,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
try
{
- uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
- xSMgr ->createInstance(::rtl::OUString("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY_THROW);
+ Reference< lang::XMultiServiceFactory > xConfigProvider = theDefaultProvider::get( comphelper::getComponentContext(xSMgr) );
uno::Sequence < uno::Any > lParams(1);
beans::PropertyValue aParam ;
@@ -889,27 +890,22 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
Reference< XMultiServiceFactory >
-TVChildTarget::getConfiguration(const Reference< XMultiServiceFactory >& m_xSMgr) const
+TVChildTarget::getConfiguration(const Reference< XComponentContext >& rxContext) const
{
- Reference< XMultiServiceFactory > sProvider;
- if( m_xSMgr.is() )
+ Reference< XMultiServiceFactory > xProvider;
+ if( rxContext.is() )
{
try
{
- rtl::OUString sProviderService =
- rtl::OUString( "com.sun.star.configuration.ConfigurationProvider" );
- sProvider =
- Reference< XMultiServiceFactory >(
- m_xSMgr->createInstance( sProviderService ),
- UNO_QUERY );
+ xProvider = theDefaultProvider::get( rxContext );
}
catch( const com::sun::star::uno::Exception& )
{
- OSL_ENSURE( sProvider.is(),"cant instantiate configuration" );
+ OSL_ENSURE( xProvider.is(),"cant instantiate configuration" );
}
}
- return sProvider;
+ return xProvider;
}
diff --git a/xmlhelp/source/treeview/tvread.hxx b/xmlhelp/source/treeview/tvread.hxx
index 2afcd10bef9f..a35da146b417 100644
--- a/xmlhelp/source/treeview/tvread.hxx
+++ b/xmlhelp/source/treeview/tvread.hxx
@@ -300,10 +300,10 @@ namespace treeview {
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
getConfiguration(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSgr ) const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) const;
::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameAccess >
- getHierAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& sProvider,
+ getHierAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxProvider,
const char* file ) const;
::rtl::OUString