diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-29 12:25:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-29 14:28:54 +0200 |
commit | 8ce81efa73f93afdf46f9586b7b6cecf36cf6914 (patch) | |
tree | c97f9a56c73403f27f07c402789bce9f1b616523 /sfx2/source | |
parent | 2e2931ba2d5cb85d93391e68296f0b29807a0fc6 (diff) |
simplify framework::TitleHelper
Every callsite (bar one) calls setOwner and connectWithUntitledNumbers after construction,
so just pass them in the constructor.
And for that lone callsite we can just nullptr as an argument.
Change-Id: If838e068bb59a407225d853a0f67983be400f2f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124426
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 | 5 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 6 |
2 files changed, 2 insertions, 9 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index e0fdd4caab63..6918f0ddf142 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3922,10 +3922,7 @@ Reference< frame::XTitle > SfxBaseModel::impl_getTitleHelper () Reference< frame::XUntitledNumbers > xDesktop( frame::Desktop::create(xContext), UNO_QUERY_THROW); Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), UNO_QUERY_THROW); - rtl::Reference<::framework::TitleHelper> pHelper = new ::framework::TitleHelper(xContext); - m_pData->m_xTitleHelper = pHelper; - pHelper->setOwner (xThis ); - pHelper->connectWithUntitledNumbers (xDesktop); + m_pData->m_xTitleHelper = new ::framework::TitleHelper(xContext, xThis, xDesktop); } return m_pData->m_xTitleHelper; diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 354f4b3ad96e..279797646018 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1427,11 +1427,7 @@ Reference< frame::XTitle > SfxBaseController::impl_getTitleHelper () Reference< frame::XUntitledNumbers > xUntitledProvider(xModel , uno::UNO_QUERY ); Reference< frame::XController > xThis (static_cast< frame::XController* >(this), uno::UNO_QUERY_THROW); - rtl::Reference<::framework::TitleHelper> pHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext()); - m_pData->m_xTitleHelper = pHelper; - - pHelper->setOwner (xThis ); - pHelper->connectWithUntitledNumbers (xUntitledProvider); + m_pData->m_xTitleHelper = new ::framework::TitleHelper(::comphelper::getProcessComponentContext(), xThis, xUntitledProvider); } return m_pData->m_xTitleHelper; |