diff options
Diffstat (limited to 'configmgr/source/defaultprovider.cxx')
-rwxr-xr-x[-rw-r--r--] | configmgr/source/defaultprovider.cxx | 76 |
1 files changed, 5 insertions, 71 deletions
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx index 16cf66df0d55..6e65301e8c82 100644..100755 --- a/configmgr/source/defaultprovider.cxx +++ b/configmgr/source/defaultprovider.cxx @@ -29,25 +29,16 @@ #include "precompiled_configmgr.hxx" #include "sal/config.h" -#include "boost/noncopyable.hpp" -#include "boost/shared_ptr.hpp" -#include "com/sun/star/lang/XSingleComponentFactory.hpp" -#include "com/sun/star/uno/Any.hxx" -#include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XInterface.hpp" -#include "cppuhelper/factory.hxx" -#include "cppuhelper/implbase1.hxx" -#include "cppuhelper/weak.hxx" -#include "sal/types.h" -#include "rtl/unload.h" +#include "osl/mutex.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "configurationprovider.hxx" +#include "defaultprovider.hxx" #include "lock.hxx" namespace configmgr { namespace default_provider { @@ -56,63 +47,15 @@ namespace { namespace css = com::sun::star; -class Factory: - public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >, - private boost::noncopyable +css::uno::Reference< css::uno::XInterface > create( + css::uno::Reference< css::uno::XComponentContext > const & context) { -public: - Factory() - { - lock_ = lock(); - } - -private: - virtual ~Factory() {} - - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstanceWithContext( - css::uno::Reference< css::uno::XComponentContext > const & Context) - throw (css::uno::Exception, css::uno::RuntimeException); - - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any > const & Arguments, - css::uno::Reference< css::uno::XComponentContext > const & Context) - throw (css::uno::Exception, css::uno::RuntimeException); - - boost::shared_ptr<osl::Mutex> lock_; -}; - -css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext( - css::uno::Reference< css::uno::XComponentContext > const & Context) - throw (css::uno::Exception, css::uno::RuntimeException) -{ - return createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any >(), Context); -} - -css::uno::Reference< css::uno::XInterface > -Factory::createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any > const & Arguments, - css::uno::Reference< css::uno::XComponentContext > const & Context) - throw (css::uno::Exception, css::uno::RuntimeException) -{ - if (Arguments.getLength() != 0) { - throw css::uno::Exception( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.DefaultProvider must be" - " instantiated without arguments")), - static_cast< cppu::OWeakObject * >(this)); - } osl::MutexGuard guard(*lock_); static css::uno::Reference< css::uno::XInterface > singleton( - configuration_provider::createDefault(Context)); + configuration_provider::createDefault(context)); return singleton; } -} - rtl::OUString getImplementationName() { return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -126,15 +69,6 @@ css::uno::Sequence< rtl::OUString > getSupportedServiceNames() { return css::uno::Sequence< rtl::OUString >(&name, 1); } -css::uno::Reference< css::lang::XSingleComponentFactory > -SAL_CALL createFactory( - cppu::ComponentFactoryFunc, rtl::OUString const &, - css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *) - SAL_THROW(()) -{ - return new Factory; -} - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |