diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-03 15:29:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-04 07:44:26 +0100 |
commit | 23255d395f40f6a20635b6f1c39e9d59a2047586 (patch) | |
tree | 53ee80f4e67518dc7d6a31a38baeb7ae059bc86c /sfx2/source | |
parent | 3165f0ff32b002a6efbc61af4f778ba4075b496e (diff) |
elide unnecessary UNO_QUERY_THROW calls
Change-Id: I0d0fc57f352e9717e721416c8941cfcf48af24c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124650
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 88d87f18da4b..28afbd7e5bad 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3926,9 +3926,8 @@ Reference< frame::XTitle > SfxBaseModel::impl_getTitleHelper () { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< frame::XUntitledNumbers > xDesktop( frame::Desktop::create(xContext), UNO_QUERY_THROW); - Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), UNO_QUERY_THROW); - m_pData->m_xTitleHelper = new ::framework::TitleHelper(xContext, xThis, xDesktop); + m_pData->m_xTitleHelper = new ::framework::TitleHelper(xContext, Reference< frame::XModel >(this), xDesktop); } return m_pData->m_xTitleHelper; @@ -3941,12 +3940,9 @@ Reference< frame::XUntitledNumbers > SfxBaseModel::impl_getUntitledHelper () if ( ! m_pData->m_xNumberedControllers.is ()) { - Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), UNO_QUERY_THROW); rtl::Reference<::comphelper::NumberedCollection> pHelper = new ::comphelper::NumberedCollection(); - m_pData->m_xNumberedControllers = pHelper; - - pHelper->setOwner (xThis); + pHelper->setOwner (Reference< frame::XModel >(this)); pHelper->setUntitledPrefix (" : "); } diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 279797646018..b6abf029dc67 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1425,9 +1425,9 @@ Reference< frame::XTitle > SfxBaseController::impl_getTitleHelper () { Reference< frame::XModel > xModel = getModel (); Reference< frame::XUntitledNumbers > xUntitledProvider(xModel , uno::UNO_QUERY ); - Reference< frame::XController > xThis (static_cast< frame::XController* >(this), uno::UNO_QUERY_THROW); - m_pData->m_xTitleHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext(), xThis, xUntitledProvider); + m_pData->m_xTitleHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext(), + Reference< frame::XController >(this), xUntitledProvider); } return m_pData->m_xTitleHelper; |