Kaydet (Commit) a6e19ea7 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Stephan Bergmann

use WeakImplHelper for ActivaDataSink

Change-Id: Ife32157ff876a0860b3920cadc24b7888200796b
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 8556cd88
...@@ -20,51 +20,31 @@ ...@@ -20,51 +20,31 @@
#ifndef INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX #ifndef INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX
#define INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX #define INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XActiveDataSink.hpp>
#include <cppuhelper/weak.hxx>
#include <ucbhelper/macros.hxx>
#include <ucbhelper/ucbhelperdllapi.h> #include <ucbhelper/ucbhelperdllapi.h>
#include <cppuhelper/implbase1.hxx>
namespace ucbhelper namespace ucbhelper
{ {
/** /**
* This class implements the interface com::sun::star::io::XActiveDataSink. * This class implements the interface com::sun::star::io::XActiveDataSink.
* Instances of this class can be passed with the parameters of an * Instances of this class can be passed with the parameters of an
* "open" command. * "open" command.
*/ */
class UCBHELPER_DLLPUBLIC ActiveDataSink : public cppu::OWeakObject, class UCBHELPER_DLLPUBLIC ActiveDataSink :
public com::sun::star::lang::XTypeProvider, public cppu::WeakImplHelper1< css::io::XActiveDataSink >
public com::sun::star::io::XActiveDataSink
{ {
com::sun::star::uno::Reference< css::uno::Reference< css::io::XInputStream > m_xStream;
com::sun::star::io::XInputStream > m_xStream;
public: public:
// XInterface // XActiveDataSink methods.
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) virtual void SAL_CALL setInputStream( const css::uno::Reference< css::io::XInputStream >& aStream )
throw( css::uno::RuntimeException, std::exception ); throw( css::uno::RuntimeException, std::exception );
virtual void SAL_CALL acquire()
throw();
virtual void SAL_CALL release()
throw();
// XTypeProvider virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream()
XTYPEPROVIDER_DECL() throw( css::uno::RuntimeException, std::exception );
// XActiveDataSink methods.
virtual void SAL_CALL
setInputStream( const com::sun::star::uno::Reference<
com::sun::star::io::XInputStream >& aStream )
throw( com::sun::star::uno::RuntimeException, std::exception );
virtual com::sun::star::uno::Reference<
com::sun::star::io::XInputStream > SAL_CALL
getInputStream()
throw( com::sun::star::uno::RuntimeException, std::exception );
}; };
} /* namespace ucbhelper */ } /* namespace ucbhelper */
......
...@@ -29,58 +29,11 @@ using namespace com::sun::star; ...@@ -29,58 +29,11 @@ using namespace com::sun::star;
namespace ucbhelper namespace ucbhelper
{ {
// ActiveDataSink Implementation. // ActiveDataSink Implementation.
// XInterface methods
void SAL_CALL ActiveDataSink::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL ActiveDataSink::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL ActiveDataSink::queryInterface( const css::uno::Type & rType )
throw( css::uno::RuntimeException, std::exception )
{
css::uno::Any aRet = cppu::queryInterface( rType,
(static_cast< lang::XTypeProvider* >(this)),
(static_cast< io::XActiveDataSink* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods
XTYPEPROVIDER_IMPL_2( ActiveDataSink,
lang::XTypeProvider,
io::XActiveDataSink );
// XActiveDataSink methods. // XActiveDataSink methods.
// virtual // virtual
void SAL_CALL ActiveDataSink::setInputStream( void SAL_CALL ActiveDataSink::setInputStream( const uno::Reference< io::XInputStream >& aStream )
const uno::Reference< io::XInputStream >& aStream )
throw( uno::RuntimeException, std::exception ) throw( uno::RuntimeException, std::exception )
{ {
m_xStream = aStream; m_xStream = aStream;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment