diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-08 14:22:13 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-08 15:27:35 -0600 |
commit | b4ab8df0a470e67db245da951b4928965838c2d1 (patch) | |
tree | 529fd62c60a4e60e1187434b780098a81b6b6f5b | |
parent | a14e1cb35b93131ee8492cffdf936097f4fc8306 (diff) |
de-macroize ucbhelper commandenvironment
Change-Id: I39c7ca30d483dab3eae0f39be15ef9586aef7851
-rw-r--r-- | include/ucbhelper/commandenvironment.hxx | 46 | ||||
-rw-r--r-- | ucbhelper/source/client/commandenvironment.cxx | 70 |
2 files changed, 18 insertions, 98 deletions
diff --git a/include/ucbhelper/commandenvironment.hxx b/include/ucbhelper/commandenvironment.hxx index 9a6ad0b8db3a..172eb77774f9 100644 --- a/include/ucbhelper/commandenvironment.hxx +++ b/include/ucbhelper/commandenvironment.hxx @@ -20,27 +20,21 @@ #ifndef INCLUDED_UCBHELPER_COMMANDENVIRONMENT_HXX #define INCLUDED_UCBHELPER_COMMANDENVIRONMENT_HXX -#include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <cppuhelper/weak.hxx> -#include <ucbhelper/macros.hxx> #include <ucbhelper/ucbhelperdllapi.h> +#include <cppuhelper/implbase1.hxx> namespace ucbhelper { - struct CommandEnvironment_Impl; - - /** * This class implements the interface * com::sun::star::ucb::XCommandEnvironement. Instances of this class can * be used to supply environments to commands executed by UCB contents. */ -class UCBHELPER_DLLPUBLIC CommandEnvironment : public cppu::OWeakObject, - public com::sun::star::lang::XTypeProvider, - public com::sun::star::ucb::XCommandEnvironment +class UCBHELPER_DLLPUBLIC CommandEnvironment : + public cppu::WeakImplHelper1< css::ucb::XCommandEnvironment > { CommandEnvironment_Impl* m_pImpl; @@ -57,39 +51,21 @@ public: * @param rxProgressHandler is the implementation of a Progress * Handler or an empty reference. */ - CommandEnvironment( - const com::sun::star::uno::Reference< - com::sun::star::task::XInteractionHandler >& - rxInteractionHandler, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XProgressHandler >& - rxProgressHandler ); + CommandEnvironment( const css::uno::Reference< css::task::XInteractionHandler >& rxInteractionHandler, + const css::uno::Reference< css::ucb::XProgressHandler >& rxProgressHandler ); /** * Destructor. */ virtual ~CommandEnvironment(); - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) - throw( css::uno::RuntimeException, std::exception ); - virtual void SAL_CALL acquire() - throw(); - virtual void SAL_CALL release() - throw(); - - // XTypeProvider - XTYPEPROVIDER_DECL() - // XCommandEnvironemnt - virtual com::sun::star::uno::Reference< - com::sun::star::task::XInteractionHandler > SAL_CALL - getInteractionHandler() - throw ( com::sun::star::uno::RuntimeException, std::exception ); + virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() + throw ( css::uno::RuntimeException, + std::exception ); - virtual com::sun::star::uno::Reference< - com::sun::star::ucb::XProgressHandler > SAL_CALL - getProgressHandler() - throw ( com::sun::star::uno::RuntimeException, std::exception ); + virtual css::uno::Reference< css::ucb::XProgressHandler > SAL_CALL getProgressHandler() + throw ( css::uno::RuntimeException, + std::exception ); }; } /* namespace ucbhelper */ diff --git a/ucbhelper/source/client/commandenvironment.cxx b/ucbhelper/source/client/commandenvironment.cxx index 80b0004b6035..d083f5a8595b 100644 --- a/ucbhelper/source/client/commandenvironment.cxx +++ b/ucbhelper/source/client/commandenvironment.cxx @@ -37,35 +37,21 @@ using namespace com::sun::star::uno; namespace ucbhelper { - - - - // struct CommandEnvironment_Impl. - - - struct CommandEnvironment_Impl { Reference< XInteractionHandler > m_xInteractionHandler; - Reference< XProgressHandler > m_xProgressHandler; + Reference< XProgressHandler > m_xProgressHandler; - CommandEnvironment_Impl( - const Reference< XInteractionHandler >& rxInteractionHandler, - const Reference< XProgressHandler >& rxProgressHandler ) - : m_xInteractionHandler( rxInteractionHandler ), - m_xProgressHandler( rxProgressHandler ) {} + CommandEnvironment_Impl( const Reference< XInteractionHandler >& rxInteractionHandler, + const Reference< XProgressHandler >& rxProgressHandler ) + : m_xInteractionHandler( rxInteractionHandler ) + , m_xProgressHandler( rxProgressHandler ) {} }; - - - // CommandEnvironment Implementation. - - - CommandEnvironment::CommandEnvironment( const Reference< XInteractionHandler >& rxInteractionHandler, const Reference< XProgressHandler >& rxProgressHandler ) @@ -74,65 +60,23 @@ CommandEnvironment::CommandEnvironment( rxProgressHandler ); } - // virtual CommandEnvironment::~CommandEnvironment() { delete m_pImpl; } - - -// XInterface methods - -void SAL_CALL CommandEnvironment::acquire() - throw() -{ - OWeakObject::acquire(); -} - -void SAL_CALL CommandEnvironment::release() - throw() -{ - OWeakObject::release(); -} - -css::uno::Any SAL_CALL CommandEnvironment::queryInterface( const css::uno::Type & rType ) - throw( css::uno::RuntimeException, std::exception ) -{ - css::uno::Any aRet = cppu::queryInterface( rType, - (static_cast< XTypeProvider* >(this)), - (static_cast< XCommandEnvironment* >(this)) - ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - -// XTypeProvider methods - - - -XTYPEPROVIDER_IMPL_2( CommandEnvironment, - XTypeProvider, - XCommandEnvironment ); - - - // XCommandEnvironemnt methods. - - // virtual -Reference< XInteractionHandler > SAL_CALL -CommandEnvironment::getInteractionHandler() +Reference< XInteractionHandler > SAL_CALL CommandEnvironment::getInteractionHandler() throw ( RuntimeException, std::exception ) { return m_pImpl->m_xInteractionHandler; } - // virtual -Reference< XProgressHandler > SAL_CALL -CommandEnvironment::getProgressHandler() +Reference< XProgressHandler > SAL_CALL CommandEnvironment::getProgressHandler() throw ( RuntimeException, std::exception ) { return m_pImpl->m_xProgressHandler; |