Do not export whole class to avoid MS C++ implicitly exporting base template.

This commit is contained in:
Stephan Bergmann
2012-01-04 12:06:39 +01:00
parent a11aa274da
commit 752f69bad4
3 changed files with 23 additions and 12 deletions

View File

@@ -110,23 +110,24 @@ public:
//================================================================== //==================================================================
typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base; typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base;
// needed for some compilers // needed for some compilers
class UNOTOOLS_DLLPUBLIC OOutputStreamWrapper : public OutputStreamWrapper_Base class OOutputStreamWrapper : public OutputStreamWrapper_Base
{ {
protected:
// TODO: thread safety!
SvStream& rStream;
public: public:
OOutputStreamWrapper(SvStream& _rStream) :rStream(_rStream) { } UNOTOOLS_DLLPUBLIC OOutputStreamWrapper(SvStream& _rStream);
protected:
virtual ~OOutputStreamWrapper();
// stario::XOutputStream // stario::XOutputStream
virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
protected:
/// throws an exception according to the error flag of m_pSvStream /// throws an exception according to the error flag of m_pSvStream
void checkError() const; void checkError() const;
// TODO: thread safety!
SvStream& rStream;
}; };
//================================================================== //==================================================================
@@ -137,12 +138,15 @@ typedef ::cppu::ImplHelper1 < ::com::sun::star::io::XSeekable
/** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XOutputStream</type> /** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XOutputStream</type>
which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface). which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface).
*/ */
class UNOTOOLS_DLLPUBLIC OSeekableOutputStreamWrapper class OSeekableOutputStreamWrapper
:public OOutputStreamWrapper :public OOutputStreamWrapper
,public OSeekableOutputStreamWrapper_Base ,public OSeekableOutputStreamWrapper_Base
{ {
public: public:
OSeekableOutputStreamWrapper(SvStream& _rStream); UNOTOOLS_DLLPUBLIC OSeekableOutputStreamWrapper(SvStream& _rStream);
private:
virtual ~OSeekableOutputStreamWrapper();
// disambiguate XInterface // disambiguate XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);

View File

@@ -187,8 +187,7 @@ SvtAcceleratorConfiguration::~SvtAcceleratorConfiguration()
INetURLObject aObj( aUserConfig ); INetURLObject aObj( aUserConfig );
aObj.insertName( String::CreateFromAscii("GlobalKeyBindings.xml") ); aObj.insertName( String::CreateFromAscii("GlobalKeyBindings.xml") );
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE|STREAM_TRUNC ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE|STREAM_TRUNC );
::utl::OOutputStreamWrapper aHelper( *pStream ); com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > xOut( new utl::OOutputStreamWrapper( *pStream ) );
com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > xOut( &aHelper );
pImp->Commit( xOut ); pImp->Commit( xOut );
delete pStream; delete pStream;
} }

View File

@@ -223,7 +223,13 @@ sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getLength( ) throw (IOException
//================================================================== //==================================================================
//= OOutputStreamWrapper //= OOutputStreamWrapper
//================================================================== //==================================================================
//------------------------------------------------------------------------------
OOutputStreamWrapper::OOutputStreamWrapper(SvStream& _rStream):
rStream(_rStream)
{}
OOutputStreamWrapper::~OOutputStreamWrapper() {}
void SAL_CALL OOutputStreamWrapper::writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException ) void SAL_CALL OOutputStreamWrapper::writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
{ {
sal_uInt32 nWritten = rStream.Write(aData.getConstArray(),aData.getLength()); sal_uInt32 nWritten = rStream.Write(aData.getConstArray(),aData.getLength());
@@ -265,6 +271,8 @@ OSeekableOutputStreamWrapper::OSeekableOutputStreamWrapper(SvStream& _rStream)
{ {
} }
OSeekableOutputStreamWrapper::~OSeekableOutputStreamWrapper() {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Any SAL_CALL OSeekableOutputStreamWrapper::queryInterface( const Type& _rType ) throw (RuntimeException) Any SAL_CALL OSeekableOutputStreamWrapper::queryInterface( const Type& _rType ) throw (RuntimeException)
{ {