diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-02 10:04:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-02 12:23:16 +0200 |
commit | 5797d29e9ead0a3dd181b616dfcc968a9127012d (patch) | |
tree | ec8828c4c2e7617f8d8e9334507bab517aed6dc9 /framework/source/jobs | |
parent | 4ea0390faa22037f1d4f703c0882a027cf2ae643 (diff) |
use uno::Reference::set method instead of assignment
Change-Id: Ic979f8a7734d0ef7a915d47a875cdcd460c0cc58
Diffstat (limited to 'framework/source/jobs')
-rw-r--r-- | framework/source/jobs/helponstartup.cxx | 10 | ||||
-rw-r--r-- | framework/source/jobs/job.cxx | 22 | ||||
-rw-r--r-- | framework/source/jobs/jobdispatch.cxx | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx index eb31a948bca1..79c976e69433 100644 --- a/framework/source/jobs/helponstartup.cxx +++ b/framework/source/jobs/helponstartup.cxx @@ -55,7 +55,7 @@ DEFINE_INIT_SERVICE(HelpOnStartup, m_xDesktop = css::frame::Desktop::create(m_xContext); - m_xConfig = css::uno::Reference< css::container::XNameAccess >( + m_xConfig.set( ::comphelper::ConfigurationHelper::openConfig( m_xContext, "/org.openoffice.Setup/Office/Factories", @@ -81,13 +81,13 @@ DEFINE_INIT_SERVICE(HelpOnStartup, // Start listening for disposing events of these services, // so we can react e.g. for an office shutdown css::uno::Reference< css::lang::XComponent > xComponent; - xComponent = css::uno::Reference< css::lang::XComponent >(m_xModuleManager, css::uno::UNO_QUERY); + xComponent.set(m_xModuleManager, css::uno::UNO_QUERY); if (xComponent.is()) xComponent->addEventListener(static_cast< css::lang::XEventListener* >(this)); - xComponent = css::uno::Reference< css::lang::XComponent >(m_xDesktop, css::uno::UNO_QUERY); + xComponent.set(m_xDesktop, css::uno::UNO_QUERY); if (xComponent.is()) xComponent->addEventListener(static_cast< css::lang::XEventListener* >(this)); - xComponent = css::uno::Reference< css::lang::XComponent >(m_xConfig, css::uno::UNO_QUERY); + xComponent.set(m_xConfig, css::uno::UNO_QUERY); if (xComponent.is()) xComponent->addEventListener(static_cast< css::lang::XEventListener* >(this)); } @@ -187,7 +187,7 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::be if (xController.is()) xFrame = xController->getFrame(); if (xFrame.is() && xFrame->isTop()) - xDesktopCheck = css::uno::Reference< css::frame::XDesktop >(xFrame->getCreator(), css::uno::UNO_QUERY); + xDesktopCheck.set(xFrame->getCreator(), css::uno::UNO_QUERY); if (!xDesktopCheck.is()) return OUString(); diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx index bcf91bc6ac2c..9c4a094d8f1e 100644 --- a/framework/source/jobs/job.cxx +++ b/framework/source/jobs/job.cxx @@ -181,9 +181,9 @@ void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lD // We must check for the supported interface on demand! // But we preferr the synchronous one ... m_xJob = m_xContext->getServiceManager()->createInstanceWithContext(m_aJobCfg.getService(), m_xContext); - xSJob = css::uno::Reference< css::task::XJob >(m_xJob, css::uno::UNO_QUERY); + xSJob.set(m_xJob, css::uno::UNO_QUERY); if (!xSJob.is()) - xAJob = css::uno::Reference< css::task::XAsyncJob >(m_xJob, css::uno::UNO_QUERY); + xAJob.set(m_xJob, css::uno::UNO_QUERY); // execute it asynchron if (xAJob.is()) @@ -297,12 +297,12 @@ void Job::die() } } - m_xJob = css::uno::Reference< css::uno::XInterface >(); - m_xFrame = css::uno::Reference< css::frame::XFrame >(); - m_xModel = css::uno::Reference< css::frame::XModel >(); - m_xDesktop = css::uno::Reference< css::frame::XDesktop2 >(); - m_xResultListener = css::uno::Reference< css::frame::XDispatchResultListener >(); - m_xResultSourceFake = css::uno::Reference< css::uno::XInterface >(); + m_xJob.clear(); + m_xFrame.clear(); + m_xModel.clear(); + m_xDesktop.clear(); + m_xResultListener.clear(); + m_xResultSourceFake.clear(); m_bPendingCloseFrame = false; m_bPendingCloseModel = false; } @@ -633,7 +633,7 @@ void SAL_CALL Job::jobFinished( /*IN*/ const css::uno::Reference< css::task::XAs impl_reactForJobResult(aResult); // Let the job die! - m_xJob = css::uno::Reference< css::uno::XInterface >(); + m_xJob.clear(); } // And let the start method "execute()" finishing it's job. @@ -813,12 +813,12 @@ void SAL_CALL Job::disposing( const css::lang::EventObject& aEvent ) throw(css:: } else if (m_xFrame.is() && aEvent.Source == m_xFrame) { - m_xFrame = css::uno::Reference< css::frame::XFrame >(); + m_xFrame.clear(); m_bListenOnFrame = false; } else if (m_xModel.is() && aEvent.Source == m_xModel) { - m_xModel = css::uno::Reference< css::frame::XModel >(); + m_xModel.clear(); m_bListenOnModel = false; } diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx index 907cd3fe002c..c45364d209a4 100644 --- a/framework/source/jobs/jobdispatch.cxx +++ b/framework/source/jobs/jobdispatch.cxx @@ -214,7 +214,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL JobDispatch::queryDispatch JobURL aAnalyzedURL(aURL.Complete); if (aAnalyzedURL.isValid()) - xDispatch = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); + xDispatch.set( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); return xDispatch; } |