summaryrefslogtreecommitdiffstats
path: root/cppu
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-10-09 14:19:25 +0000
committerKurt Zenker <kz@openoffice.org>2007-10-09 14:19:25 +0000
commit86280e3a3209f0162100e7c50856fab12934aeda (patch)
tree0fc490fef31f4262d61c8048a08bbd9a78af74de /cppu
parentINTEGRATION: CWS basmgr03 (1.18.56); FILE MERGED (diff)
downloadcore-86280e3a3209f0162100e7c50856fab12934aeda.tar.gz
core-86280e3a3209f0162100e7c50856fab12934aeda.zip
INTEGRATION: CWS basmgr03 (1.25.56); FILE MERGED
2007/07/26 08:51:32 fs 1.25.56.1: #i80044# +UNO_SET_THROW
Diffstat (limited to 'cppu')
-rw-r--r--cppu/inc/com/sun/star/uno/Reference.hxx47
1 files changed, 45 insertions, 2 deletions
diff --git a/cppu/inc/com/sun/star/uno/Reference.hxx b/cppu/inc/com/sun/star/uno/Reference.hxx
index a0b5eae6d5c9..c31a400ab6ae 100644
--- a/cppu/inc/com/sun/star/uno/Reference.hxx
+++ b/cppu/inc/com/sun/star/uno/Reference.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: Reference.hxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: hr $ $Date: 2006-06-19 13:11:13 $
+ * last change: $Author: kz $ $Date: 2007-10-09 15:19:25 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -85,6 +85,9 @@ inline XInterface * Reference< interface_type >::iquery(
extern "C" rtl_uString * SAL_CALL cppu_unsatisfied_iquery_msg(
typelib_TypeDescriptionReference * pType )
SAL_THROW_EXTERN_C();
+extern "C" rtl_uString * SAL_CALL cppu_unsatisfied_iset_msg(
+ typelib_TypeDescriptionReference * pType )
+ SAL_THROW_EXTERN_C();
//__________________________________________________________________________________________________
inline XInterface * BaseReference::iquery_throw(
XInterface * pInterface, const Type & rType )
@@ -105,6 +108,20 @@ inline XInterface * Reference< interface_type >::iquery_throw(
return BaseReference::iquery_throw(
pInterface, interface_type::static_type());
}
+//__________________________________________________________________________________________________
+template< class interface_type >
+inline interface_type * Reference< interface_type >::iset_throw(
+ interface_type * pInterface ) SAL_THROW( (RuntimeException) )
+{
+ if (pInterface)
+ {
+ pInterface->acquire();
+ return pInterface;
+ }
+ throw RuntimeException(
+ ::rtl::OUString( cppu_unsatisfied_iset_msg( interface_type::static_type().getTypeLibType() ), SAL_NO_ACQUIRE ),
+ NULL );
+}
#endif
//__________________________________________________________________________________________________
@@ -187,6 +204,18 @@ inline Reference< interface_type >::Reference( const Any & rAny, UnoReference_Qu
_pInterface = iquery_throw( typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass
? static_cast< XInterface * >( rAny.pReserved ) : 0 );
}
+//__________________________________________________________________________________________________
+template< class interface_type >
+inline Reference< interface_type >::Reference( const Reference< interface_type > & rRef, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
+{
+ _pInterface = iset_throw( rRef.get() );
+}
+//__________________________________________________________________________________________________
+template< class interface_type >
+inline Reference< interface_type >::Reference( interface_type * pInterface, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
+{
+ _pInterface = iset_throw( pInterface );
+}
#endif
//__________________________________________________________________________________________________
@@ -294,6 +323,20 @@ inline void Reference< interface_type >::set(
? static_cast< XInterface * >( rAny.pReserved ) : 0 )),
SAL_NO_ACQUIRE );
}
+//__________________________________________________________________________________________________
+template< class interface_type >
+inline void Reference< interface_type >::set(
+ interface_type * pInterface, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
+{
+ set( iset_throw( pInterface ), SAL_NO_ACQUIRE );
+}
+//__________________________________________________________________________________________________
+template< class interface_type >
+inline void Reference< interface_type >::set(
+ const Reference< interface_type > & rRef, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
+{
+ set( rRef.get(), UNO_SET_THROW );
+}
#endif