From 16ffd2fd242b1c98cbafedb1015107713957c2e9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 9 Sep 2011 17:06:55 +0200 Subject: sb140: #i117292# use ImplInheritanceHelper --- io/source/TextInputStream/TextInputStream.cxx | 1 - io/source/TextOutputStream/TextOutputStream.cxx | 2 - io/source/connector/connector.cxx | 1 - io/source/stm/odata.cxx | 141 +----------------------- 4 files changed, 5 insertions(+), 140 deletions(-) (limited to 'io') diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx index dc2b5744a7fc..4d8f931d5db1 100644 --- a/io/source/TextInputStream/TextInputStream.cxx +++ b/io/source/TextInputStream/TextInputStream.cxx @@ -31,7 +31,6 @@ #include -#include #include #include diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx index bd4325ab11f2..5952601dd140 100644 --- a/io/source/TextOutputStream/TextOutputStream.cxx +++ b/io/source/TextOutputStream/TextOutputStream.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_io.hxx" - -#include #include #include diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 38a44eaa066a..04ef6469228a 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -28,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_io.hxx" -#include #include "osl/security.hxx" #include diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx index 338df98b7e7b..a761947dddfe 100644 --- a/io/source/stm/odata.cxx +++ b/io/source/stm/odata.cxx @@ -46,11 +46,8 @@ #include // OWeakObject #include +#include #include -#include -#include - -#include #include @@ -962,10 +959,8 @@ typedef boost::unordered_map * * *--------------------------------------------*/ -class OObjectOutputStream : - public ODataOutputStream, - public XObjectOutputStream, - public XMarkableStream +class OObjectOutputStream: public ImplInheritanceHelper2< + ODataOutputStream, XObjectOutputStream, XMarkableStream > { public: OObjectOutputStream() @@ -977,11 +972,6 @@ public: ~OObjectOutputStream(); -public: - Any SAL_CALL queryInterface( const Type &type ) throw (::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { ODataOutputStream::acquire(); } - void SAL_CALL release() throw() { ODataOutputStream::release(); } - public: // XOutputStream virtual void SAL_CALL writeBytes(const Sequence< sal_Int8 >& aData) @@ -1034,12 +1024,6 @@ public: // XMarkableStream virtual sal_Int32 SAL_CALL offsetToMark(sal_Int32 nMark) throw (IOException, IllegalArgumentException, RuntimeException); -public: //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL - getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - public: // XServiceInfo OUString SAL_CALL getImplementationName() throw (); Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw (); @@ -1059,20 +1043,6 @@ OObjectOutputStream::~OObjectOutputStream() g_moduleCount.modCnt.release( &g_moduleCount.modCnt ); } -Any OObjectOutputStream::queryInterface( const Type &aType ) throw (::com::sun::star::uno::RuntimeException) -{ - Any a = ::cppu::queryInterface( - aType , - SAL_STATIC_CAST( XMarkableStream * , this ), - SAL_STATIC_CAST( XObjectOutputStream * , this ) ); - if( a.hasValue() ) - { - return a; - } - - return ODataOutputStream::queryInterface( aType ); - -} void OObjectOutputStream::writeObject( const Reference< XPersistObject > & xPObj ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) { @@ -1237,40 +1207,6 @@ Sequence OObjectOutputStream_getSupportedServiceNames(void) return aRet; } -Sequence< Type > SAL_CALL OObjectOutputStream::getTypes(void) throw( RuntimeException ) -{ - static OTypeCollection *pCollection = 0; - if( ! pCollection ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pCollection ) - { - static OTypeCollection collection( - getCppuType( (Reference< XMarkableStream > * ) 0 ), - getCppuType( (Reference< XObjectOutputStream > * ) 0 ), - ODataOutputStream::getTypes() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); -} - -Sequence< sal_Int8 > SAL_CALL OObjectOutputStream::getImplementationId( ) throw( RuntimeException) -{ - static OImplementationId *pId = 0; - if( ! pId ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pId ) - { - static OImplementationId id( sal_False ); - pId = &id; - } - } - return (*pId).getImplementationId(); -} - - // XServiceInfo OUString OObjectOutputStream::getImplementationName() throw () { @@ -1296,14 +1232,8 @@ Sequence< OUString > OObjectOutputStream::getSupportedServiceNames(void) throw ( return OObjectOutputStream_getSupportedServiceNames(); } - - - - -class OObjectInputStream : - public ODataInputStream, - public XObjectInputStream, - public XMarkableStream +class OObjectInputStream: public ImplInheritanceHelper2< + ODataInputStream, XObjectInputStream, XMarkableStream > { public: OObjectInputStream( const Reference < XComponentContext > &r) @@ -1315,11 +1245,6 @@ public: } ~OObjectInputStream(); -public: - Any SAL_CALL queryInterface( const Type &type ) throw(); - void SAL_CALL acquire() throw() { ODataInputStream::acquire(); } - void SAL_CALL release() throw() { ODataInputStream::release(); } - public: // XInputStream virtual sal_Int32 SAL_CALL readBytes(Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw ( NotConnectedException, @@ -1381,12 +1306,6 @@ public: // XMarkableStream virtual sal_Int32 SAL_CALL offsetToMark(sal_Int32 nMark) throw (IOException, IllegalArgumentException, RuntimeException); -public: //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL - getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL - getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - public: // XServiceInfo OUString SAL_CALL getImplementationName() throw (); Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw (); @@ -1408,21 +1327,6 @@ OObjectInputStream::~OObjectInputStream() g_moduleCount.modCnt.release( &g_moduleCount.modCnt ); } -Any OObjectInputStream::queryInterface( const Type &aType ) throw () -{ - Any a = ::cppu::queryInterface( - aType , - SAL_STATIC_CAST( XMarkableStream * , this ), - SAL_STATIC_CAST( XObjectInputStream * , this ) ); - if( a.hasValue() ) - { - return a; - } - - return ODataInputStream::queryInterface( aType ); - -} - Reference< XPersistObject > OObjectInputStream::readObject() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) { // check if chain contains a XMarkableStream @@ -1578,41 +1482,6 @@ sal_Int32 OObjectInputStream::offsetToMark(sal_Int32 nMark) return m_rMarkable->offsetToMark( nMark ); } - -Sequence< Type > SAL_CALL OObjectInputStream::getTypes(void) throw( RuntimeException ) -{ - static OTypeCollection *pCollection = 0; - if( ! pCollection ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pCollection ) - { - static OTypeCollection collection( - getCppuType( (Reference< XMarkableStream > * ) 0 ), - getCppuType( (Reference< XObjectInputStream > * ) 0 ), - ODataInputStream::getTypes() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); -} - -Sequence< sal_Int8 > SAL_CALL OObjectInputStream::getImplementationId( ) throw( RuntimeException) -{ - static OImplementationId *pId = 0; - if( ! pId ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pId ) - { - static OImplementationId id( sal_False ); - pId = &id; - } - } - return (*pId).getImplementationId(); -} - - // XServiceInfo OUString OObjectInputStream::getImplementationName() throw () { -- cgit v1.2.3