Kaydet (Commit) 8483543d authored tarafından Herbert Dürr's avatar Herbert Dürr

fix css::uno's throwing Reference constructors

The destructor of the Reference class depends on its _pInterface member being set,
but some constructors skip this when an exception was thrown. Always initializing
them properly while avoiding a rethrow is cheap and safe.

Fixed-By: Herbert Dürr, Andre Fischer
üst c90a6ca9
......@@ -171,18 +171,21 @@ inline Reference< interface_type >::Reference( const Any & rAny, UnoReference_Qu
template< class interface_type >
inline Reference< interface_type >::Reference( const BaseReference & rRef, UnoReference_QueryThrow ) SAL_THROW( (RuntimeException) )
{
_pInterface = NULL;
_pInterface = iquery_throw( rRef.get() );
}
//__________________________________________________________________________________________________
template< class interface_type >
inline Reference< interface_type >::Reference( XInterface * pInterface, UnoReference_QueryThrow ) SAL_THROW( (RuntimeException) )
{
_pInterface = NULL;
_pInterface = iquery_throw( pInterface );
}
//__________________________________________________________________________________________________
template< class interface_type >
inline Reference< interface_type >::Reference( const Any & rAny, UnoReference_QueryThrow ) SAL_THROW( (RuntimeException) )
{
_pInterface = NULL;
_pInterface = iquery_throw( typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass
? static_cast< XInterface * >( rAny.pReserved ) : 0 );
}
......@@ -190,12 +193,14 @@ inline Reference< interface_type >::Reference( const Any & rAny, UnoReference_Qu
template< class interface_type >
inline Reference< interface_type >::Reference( const Reference< interface_type > & rRef, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
{
_pInterface = NULL;
_pInterface = iset_throw( rRef.get() );
}
//__________________________________________________________________________________________________
template< class interface_type >
inline Reference< interface_type >::Reference( interface_type * pInterface, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) )
{
_pInterface = NULL;
_pInterface = iset_throw( pInterface );
}
#endif
......
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