diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 20:06:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 07:55:40 +0200 |
commit | 952b806c22f798977f5478dd630131acf1a5f068 (patch) | |
tree | 9abbb9c472343200ecf9d7afa7a1589b5686fa7d /framework/source/loadenv | |
parent | 85b1d47450fa33f772d06353c4dad8da4d22f114 (diff) |
loplugin:referencecasting in framework
Change-Id: I49aee4023fdb3173d842c19a53f9170ca1e725e4
Reviewed-on: https://gerrit.libreoffice.org/75972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/loadenv')
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 412ffef4d8ac..6fe947adc645 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -444,13 +444,13 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::getTargetComponent() const css::uno::Reference< css::frame::XController > xController = m_xTargetFrame->getController(); if (!xController.is()) - return css::uno::Reference< css::lang::XComponent >(m_xTargetFrame->getComponentWindow(), css::uno::UNO_QUERY); + return m_xTargetFrame->getComponentWindow(); css::uno::Reference< css::frame::XModel > xModel = xController->getModel(); if (!xModel.is()) - return css::uno::Reference< css::lang::XComponent >(xController, css::uno::UNO_QUERY); + return xController; - return css::uno::Reference< css::lang::XComponent >(xModel, css::uno::UNO_QUERY); + return xModel; } void SAL_CALL LoadEnvListener::loadFinished(const css::uno::Reference< css::frame::XFrameLoader >&) @@ -1291,7 +1291,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // otherwise - iterate through the tasks of the desktop container // to find out, which of them might contains the requested document css::uno::Reference< css::frame::XDesktop2 > xSupplier = css::frame::Desktop::create( m_xContext ); - css::uno::Reference< css::container::XIndexAccess > xTaskList(xSupplier->getFrames() , css::uno::UNO_QUERY); + css::uno::Reference< css::container::XIndexAccess > xTaskList = xSupplier->getFrames(); if (!xTaskList.is()) return css::uno::Reference< css::frame::XFrame >(); // task list can be empty! @@ -1422,7 +1422,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget() if (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false)) return css::uno::Reference< css::frame::XFrame >(); - css::uno::Reference< css::frame::XFramesSupplier > xSupplier( css::frame::Desktop::create( m_xContext ), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XFramesSupplier > xSupplier = css::frame::Desktop::create( m_xContext ); FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< css::frame::XFrame >(), FrameAnalyzerFlags::BackingComponent); if (aTasksAnalyzer.m_xBackingComponent.is()) { @@ -1616,15 +1616,13 @@ void LoadEnv::impl_reactForLoadingState() { // close empty frames css::uno::Reference< css::util::XCloseable > xCloseable (m_xTargetFrame, css::uno::UNO_QUERY); - css::uno::Reference< css::lang::XComponent > xDisposable(m_xTargetFrame, css::uno::UNO_QUERY); try { if (xCloseable.is()) xCloseable->close(true); - else - if (xDisposable.is()) - xDisposable->dispose(); + else if (m_xTargetFrame.is()) + m_xTargetFrame->dispose(); } catch(const css::util::CloseVetoException&) {} |