diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2002-08-26 06:39:11 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2002-08-26 06:39:11 +0000 |
commit | e5b55ae7e326a89e874e8976c5b69b5af8a34092 (patch) | |
tree | 50de7ccd5653c0df56577f18208e8e2d735d720e /extensions/source/activex/main/SODispatchInterceptor.cpp | |
parent | aafdab9b8b2e25c926ce7bb41b96536585b6fb86 (diff) |
#101937# improve registration
Diffstat (limited to 'extensions/source/activex/main/SODispatchInterceptor.cpp')
-rw-r--r-- | extensions/source/activex/main/SODispatchInterceptor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/extensions/source/activex/main/SODispatchInterceptor.cpp b/extensions/source/activex/main/SODispatchInterceptor.cpp index 048f0e606734..c3b8f5b3b4f7 100644 --- a/extensions/source/activex/main/SODispatchInterceptor.cpp +++ b/extensions/source/activex/main/SODispatchInterceptor.cpp @@ -47,7 +47,14 @@ STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL, if( !strncmp( OLE2T( aTargetUrl.bstrVal ), "ftp://", 6 ) || !strncmp( OLE2T( aTargetUrl.bstrVal ), "http://", 7 ) || !strncmp( OLE2T( aTargetUrl.bstrVal ), "file://", 7 ) ) - *retVal = this; + { + CComQIPtr< IDispatch, &IID_IDispatch > pIDisp( this ); + if( pIDisp ) + { + this->AddRef(); + *retVal = pIDisp; + } + } else { if( !m_xSlave ) @@ -63,9 +70,11 @@ STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL, if( !SUCCEEDED( hr ) || aResult.vt != VT_DISPATCH || aResult.pdispVal == NULL ) return E_FAIL; *retVal = aResult.pdispVal; + /* following code is workaround for UNO bug CComQIPtr< IUnknown, &IID_IUnknown > pIUnk( *retVal ); if( pIUnk ) (*retVal)->AddRef(); + */ } return S_OK; |