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