diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-30 14:02:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-31 15:31:36 +0100 |
commit | 0ac9a10d312dc8f12a74720ce211823ce4addf7b (patch) | |
tree | 2c812432eca9315170af8b5b6b7ae5bcbf828d5b /framework/inc/jobs | |
parent | d27c92961b78da138d3563ab596cca416af9eb38 (diff) |
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
Diffstat (limited to 'framework/inc/jobs')
-rw-r--r-- | framework/inc/jobs/configaccess.hxx | 7 | ||||
-rw-r--r-- | framework/inc/jobs/jobdata.hxx | 11 |
2 files changed, 10 insertions, 8 deletions
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 <general.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ustring.hxx> #include <fwidllapi.h> @@ -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 <general.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/frame/DispatchResultEvent.hpp> @@ -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 ); |