diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:15:03 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:15:03 +0000 |
commit | b8e83bbec8ff4f583bde689f9e05c22b28aed17f (patch) | |
tree | 49a15926cb62f8998d88de2d5554d1d39106b517 /cppu | |
parent | 4855abb2622fecbd29cc6edad8ada478bb8f3cc1 (diff) |
INTEGRATION: CWS sb10 (1.13.6); FILE MERGED
2003/12/18 10:38:10 sb 1.13.6.2: #114000# Added missing reinterpret_casts between XInterface and interface_type.
2003/12/10 08:48:49 sb 1.13.6.1: #114000# Adapted to multiple-inheritance interface types.
Diffstat (limited to 'cppu')
-rw-r--r-- | cppu/inc/com/sun/star/uno/Reference.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cppu/inc/com/sun/star/uno/Reference.h b/cppu/inc/com/sun/star/uno/Reference.h index cd4a63d5e5c2..9a4ef71bc728 100644 --- a/cppu/inc/com/sun/star/uno/Reference.h +++ b/cppu/inc/com/sun/star/uno/Reference.h @@ -2,9 +2,9 @@ * * $RCSfile: Reference.h,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: vg $ $Date: 2003-10-06 13:01:03 $ + * last change: $Author: hr $ $Date: 2004-02-03 12:15:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,6 +99,15 @@ class BaseReference { protected: /** the interface pointer + + <p>To work around ambiguities in the case of multiple-inheritance + interface types (which inherit <code>XInterface</code> more than once), + dervied <code>Reference</code> instances use + <code>reinterpret_cast</code> to switch <code>_pInterface</code> from a + pointer to <code>XInterface</code> to a pointer to a derived interface + type, and vice versa. <em>In principle, this is not guaranteed to + work.</em> In practice, it seems to work on all supported + platforms.</p> */ XInterface * _pInterface; @@ -212,7 +221,7 @@ class Reference : public BaseReference @param pInterface interface pointer @return interface of demanded type (may be null) */ - inline static interface_type * SAL_CALL iquery( XInterface * pInterface ) + inline static XInterface * SAL_CALL iquery( XInterface * pInterface ) SAL_THROW( (RuntimeException) ); #ifndef EXCEPTIONS_OFF /** Queries given interface for type interface_type. @@ -221,7 +230,7 @@ class Reference : public BaseReference @param pInterface interface pointer @return interface of demanded type */ - inline static interface_type * SAL_CALL iquery_throw( XInterface * pInterface ) + inline static XInterface * SAL_CALL iquery_throw( XInterface * pInterface ) SAL_THROW( (RuntimeException) ); #endif @@ -331,14 +340,14 @@ public: @return UNacquired interface pointer */ inline interface_type * SAL_CALL operator -> () const SAL_THROW( () ) - { return static_cast< interface_type * >( _pInterface ); } + { return reinterpret_cast< interface_type * >( _pInterface ); } /** Gets interface pointer. This call does not acquire the interface. @return UNacquired interface pointer */ inline interface_type * SAL_CALL get() const SAL_THROW( () ) - { return static_cast< interface_type * >( _pInterface ); } + { return reinterpret_cast< interface_type * >( _pInterface ); } /** Clears reference, i.e. releases interface. Reference is null after clear() call. */ |