Kaydet (Commit) 2bbf21aa authored tarafından Noel Grandin's avatar Noel Grandin

use rtl::Reference in DocumentHolder

instead of manual acquire/release

Change-Id: Id795dca5ff9e392fa2649f4721a73ce3ffd6de2c
üst 4f5b22b9
......@@ -149,7 +149,6 @@ static void InsertMenu_Impl( const uno::Reference< container::XIndexContainer >&
DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& xContext,
OCommonEmbeddedObject* pEmbObj )
: m_pEmbedObj( pEmbObj ),
m_pInterceptor( nullptr ),
m_xContext( xContext ),
m_bReadOnly( false ),
m_bWaitForClose( false ),
......@@ -200,10 +199,10 @@ DocumentHolder::~DocumentHolder()
} catch( const uno::Exception& ) {}
}
if ( m_pInterceptor )
if ( m_xInterceptor.is() )
{
m_pInterceptor->DisconnectDocHolder();
m_pInterceptor->release();
m_xInterceptor->DisconnectDocHolder();
m_xInterceptor.clear();
}
if ( !m_bDesktopTerminated )
......@@ -837,17 +836,15 @@ uno::Reference< frame::XFrame > const & DocumentHolder::GetDocFrame()
uno::Reference< frame::XDispatchProviderInterception > xInterception( m_xFrame, uno::UNO_QUERY );
if ( xInterception.is() )
{
if ( m_pInterceptor )
if ( m_xInterceptor.is() )
{
m_pInterceptor->DisconnectDocHolder();
m_pInterceptor->release();
m_pInterceptor = nullptr;
m_xInterceptor->DisconnectDocHolder();
m_xInterceptor.clear();
}
m_pInterceptor = new Interceptor( this );
m_pInterceptor->acquire();
m_xInterceptor = new Interceptor( this );
xInterception->registerDispatchProviderInterceptor( m_pInterceptor );
xInterception->registerDispatchProviderInterceptor( m_xInterceptor.get() );
// register interceptor from outside
if ( m_xOutplaceInterceptor.is() )
......
......@@ -36,6 +36,7 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
class OCommonEmbeddedObject;
class Interceptor;
......@@ -53,7 +54,7 @@ private:
OCommonEmbeddedObject* m_pEmbedObj;
Interceptor* m_pInterceptor;
rtl::Reference<Interceptor> m_xInterceptor;
css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xOutplaceInterceptor;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
......
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