From 0ac9a10d312dc8f12a74720ce211823ce4addf7b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 30 Oct 2012 14:02:56 +0200 Subject: fdo#46808, Deprecate configuration::ConfigurationProvider old-style service ...in favor of existing new-style configuration::theDefaultProvider singleton. Theoretically, ConfigurationProvider instances can be created with specific Locale and EnableAsync arguments, but this is hardly used in practice, and thus effectively all uses of the ConfigurationProvider service use the theDefaultProvider instance, anyway. theDefaultProvider is restricted to the XMultiServiceFactory interface, while ConfigurationProvider also makes available XComponent. However, dispose must not be called manually on theDefaultProvider singleton anyway, and calls to add-/removeEventListener are so few (and in dubious code that should better be cleaned up) that requiring an explicit queryInterface does not really hurt there. This commit originated as a patch by Noel Grandin to "Adapt configuration::ConfigurationProvider UNO service to new style [by creating] a merged XConfigurationProvider interface for this service to implement." It was then modified by Stephan Bergmann by deprecating ConfigurationProvider instead of adding XConfigurationProvider and by replacing calls to ConfigurationProvider::create with calls to theDefaultProvider::get. Change-Id: I9c16700afe0faff1ef6f20338a66bd7a9af990bd --- framework/inc/jobs/configaccess.hxx | 7 ++++--- framework/inc/jobs/jobdata.hxx | 11 ++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'framework/inc/jobs') diff --git a/framework/inc/jobs/configaccess.hxx b/framework/inc/jobs/configaccess.hxx index 30ef4f2a47d8..dd9386a19630 100644 --- a/framework/inc/jobs/configaccess.hxx +++ b/framework/inc/jobs/configaccess.hxx @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -65,7 +66,7 @@ class FWI_DLLPUBLIC ConfigAccess : public ThreadHelpBase reference to the uno service manager It's neccessary to instanciate own needed services. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** hold an opened configuration alive */ css::uno::Reference< css::uno::XInterface > m_xConfig; @@ -81,8 +82,8 @@ class FWI_DLLPUBLIC ConfigAccess : public ThreadHelpBase public: - ConfigAccess( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , - const ::rtl::OUString& sRoot ); + ConfigAccess( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const ::rtl::OUString& sRoot ); virtual ~ConfigAccess(); virtual void open ( EOpenMode eMode ); diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx index acb107d9d8ac..5ca4691abb12 100644 --- a/framework/inc/jobs/jobdata.hxx +++ b/framework/inc/jobs/jobdata.hxx @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -152,7 +153,7 @@ class JobData : private ThreadHelpBase We need it for creating of own uno services ... e.g. for opening the configuration. */ - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + css::uno::Reference< css::uno::XComponentContext > m_xContext; /** An instance of this class can be used in two different modes: @@ -224,7 +225,7 @@ class JobData : private ThreadHelpBase public: - JobData( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); + JobData( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); JobData( const JobData& rCopy ); virtual ~JobData( ); @@ -250,10 +251,10 @@ class JobData : private ThreadHelpBase void setResult ( const JobResult& aResult ); void disableJob ( ); - static css::uno::Sequence< ::rtl::OUString > getEnabledJobsForEvent( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , - const ::rtl::OUString& sEvent ); + static css::uno::Sequence< ::rtl::OUString > getEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const ::rtl::OUString& sEvent ); - static void appendEnabledJobsForEvent( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , + static void appendEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const ::rtl::OUString& sEvent , ::comphelper::SequenceAsVector< JobData::TJob2DocEventBinding >& lJobs ); -- cgit