summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ucbhelper/commandenvironment.hxx46
-rw-r--r--ucbhelper/source/client/commandenvironment.cxx70
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;