Do not use this in ctor
Change-Id: If2177d309626ef599c7c15f6195151dc0d0a8e30
This commit is contained in:
@@ -68,7 +68,11 @@ class UpdateCheckJob :
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
UpdateCheckJob(const uno::Reference<uno::XComponentContext>& xContext);
|
UpdateCheckJob(
|
||||||
|
css::uno::Reference<css::uno::XComponentContext> const & context,
|
||||||
|
css::uno::Reference<css::frame::XDesktop2> const & desktop):
|
||||||
|
m_xContext(context), m_xDesktop(desktop)
|
||||||
|
{}
|
||||||
|
|
||||||
static uno::Sequence< OUString > getServiceNames();
|
static uno::Sequence< OUString > getServiceNames();
|
||||||
static OUString getImplName();
|
static OUString getImplName();
|
||||||
@@ -150,19 +154,6 @@ void InitUpdateCheckJobThread::setTerminating() {
|
|||||||
m_aCondition.set();
|
m_aCondition.set();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
UpdateCheckJob::UpdateCheckJob( const uno::Reference<uno::XComponentContext>& xContext ) :
|
|
||||||
m_xContext(xContext)
|
|
||||||
{
|
|
||||||
m_xDesktop.set( frame::Desktop::create(xContext) );
|
|
||||||
m_xDesktop->addTerminateListener( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
UpdateCheckJob::~UpdateCheckJob()
|
UpdateCheckJob::~UpdateCheckJob()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -330,7 +321,11 @@ void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & )
|
|||||||
static uno::Reference<uno::XInterface> SAL_CALL
|
static uno::Reference<uno::XInterface> SAL_CALL
|
||||||
createJobInstance(const uno::Reference<uno::XComponentContext>& xContext)
|
createJobInstance(const uno::Reference<uno::XComponentContext>& xContext)
|
||||||
{
|
{
|
||||||
return *new UpdateCheckJob(xContext);
|
css::uno::Reference<css::frame::XDesktop2> desktop(
|
||||||
|
css::frame::Desktop::create(xContext));
|
||||||
|
rtl::Reference<UpdateCheckJob> job(new UpdateCheckJob(xContext, desktop));
|
||||||
|
desktop->addTerminateListener(job.get());
|
||||||
|
return static_cast<cppu::OWeakObject *>(job.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user