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 @@
#ifndef INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX
#define INCLUDED_UCBHELPER_ACTIVEDATASINK_HXX
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <cppuhelper/weak.hxx>
#include <ucbhelper/macros.hxx>
#include <ucbhelper/ucbhelperdllapi.h>
#include <cppuhelper/implbase1.hxx>
namespace ucbhelper
{
/**
* This class implements the interface com::sun::star::io::XActiveDataSink.
* Instances of this class can be passed with the parameters of an
* "open" command.
*/
class UCBHELPER_DLLPUBLIC ActiveDataSink : public cppu::OWeakObject,
public com::sun::star::lang::XTypeProvider,
public com::sun::star::io::XActiveDataSink
class UCBHELPER_DLLPUBLIC ActiveDataSink :
public cppu::WeakImplHelper1< css::io::XActiveDataSink >
{
com::sun::star::uno::Reference<
com::sun::star::io::XInputStream > m_xStream;
css::uno::Reference< css::io::XInputStream > m_xStream;
public:
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
// XActiveDataSink methods.
virtual void SAL_CALL setInputStream( const css::uno::Reference< css::io::XInputStream >& aStream )
throw( css::uno::RuntimeException, std::exception );
virtual void SAL_CALL acquire()
throw();
virtual void SAL_CALL release()
throw();
// XTypeProvider
XTYPEPROVIDER_DECL()
// 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 );
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream()
throw( css::uno::RuntimeException, std::exception );
};
} /* namespace ucbhelper */
......
......@@ -29,58 +29,11 @@ using namespace com::sun::star;
namespace ucbhelper
{
// 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.
// virtual
void SAL_CALL ActiveDataSink::setInputStream(
const uno::Reference< io::XInputStream >& aStream )
void SAL_CALL ActiveDataSink::setInputStream( const uno::Reference< io::XInputStream >& aStream )
throw( uno::RuntimeException, std::exception )
{
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