diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-07-10 14:57:02 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-07-10 14:57:02 +0000 |
commit | 84f5b9f37f39c0e0cfac2c84b477061ad1a7b1d0 (patch) | |
tree | f88497290b38d0dbd5144efe0e1967ca909eede2 /unotools | |
parent | INTEGRATION: CWS bitcount01 (1.6.232); FILE MERGED (diff) | |
download | core-84f5b9f37f39c0e0cfac2c84b477061ad1a7b1d0.tar.gz core-84f5b9f37f39c0e0cfac2c84b477061ad1a7b1d0.zip |
INTEGRATION: CWS qiq (1.3.34); FILE MERGED
2006/06/22 10:51:42 fs 1.3.34.3: #i10000# no UNO_QUERY_THROW support if not compiled with exceptions
2006/06/22 09:24:21 fs 1.3.34.2: #i10000# no UNO_QUERY_THROW support if not compiled with exceptions
2006/06/06 13:12:27 fs 1.3.34.1: #i51143# some set methods, for more syntactic equivalence with Reference
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/sharedunocomponent.hxx | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/unotools/inc/unotools/sharedunocomponent.hxx b/unotools/inc/unotools/sharedunocomponent.hxx index ee7345652077..fef974db1596 100644 --- a/unotools/inc/unotools/sharedunocomponent.hxx +++ b/unotools/inc/unotools/sharedunocomponent.hxx @@ -4,9 +4,9 @@ * * $RCSfile: sharedunocomponent.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-10-19 11:44:53 $ + * last change: $Author: obo $ $Date: 2006-07-10 15:57:02 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -204,6 +204,16 @@ namespace utl */ void reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode = TakeOwnership ); + inline bool set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query ); + inline bool set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query ); + inline bool set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query ); + +#ifndef EXCEPTIONS_OFF + inline void set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); + inline void set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); + inline void set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); +#endif + INTERFACE* SAL_CALL operator->() const; inline operator const ::com::sun::star::uno::Reference< INTERFACE >&() const @@ -266,12 +276,60 @@ namespace utl rAny <<= value.getTyped(); } + //------------------------------------------------------------------------- template < class INTERFACE, class COMPONENT > inline ::com::sun::star::uno::Any SAL_CALL makeAny( const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW( () ) { return makeAny( value.getTyped() ); } +#ifndef EXCEPTIONS_OFF + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _queryThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _queryThrow ), TakeOwnership ); + } +#endif + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _query ) ); + return is(); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _query ) ); + return is(); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _query ) ); + return is(); + } + //............................................................................ } // namespace utl //............................................................................ |