summaryrefslogtreecommitdiff
path: root/framework/source/fwe
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-29 12:25:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-29 14:28:54 +0200
commit8ce81efa73f93afdf46f9586b7b6cecf36cf6914 (patch)
treec97f9a56c73403f27f07c402789bce9f1b616523 /framework/source/fwe
parent2e2931ba2d5cb85d93391e68296f0b29807a0fc6 (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 'framework/source/fwe')
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx26
1 files changed, 8 insertions, 18 deletions
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index a3854489d0f8..5c4d07e69caa 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -48,26 +48,21 @@ using namespace css::frame;
namespace framework{
-TitleHelper::TitleHelper(const css::uno::Reference< css::uno::XComponentContext >& rxContext)
+TitleHelper::TitleHelper(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
+ const css::uno::Reference< css::uno::XInterface >& xOwner,
+ const css::uno::Reference< css::frame::XUntitledNumbers >& xNumbers)
: ::cppu::BaseMutex ()
, m_xContext (rxContext)
, m_bExternalTitle (false)
, m_nLeasedNumber (css::frame::UntitledNumbersConst::INVALID_NUMBER)
, m_aListener (m_aMutex)
{
-}
-
-TitleHelper::~TitleHelper()
-{
-}
-
-void TitleHelper::setOwner(const css::uno::Reference< css::uno::XInterface >& xOwner)
-{
// SYNCHRONIZED ->
{
osl::MutexGuard aLock(m_aMutex);
m_xOwner = xOwner;
+ m_xUntitledNumbers = xNumbers;
}
// <- SYNCHRONIZED
@@ -93,6 +88,10 @@ void TitleHelper::setOwner(const css::uno::Reference< css::uno::XInterface >& xO
}
}
+TitleHelper::~TitleHelper()
+{
+}
+
OUString SAL_CALL TitleHelper::getTitle()
{
// SYNCHRONIZED ->
@@ -115,15 +114,6 @@ OUString SAL_CALL TitleHelper::getTitle()
// <- SYNCHRONIZED
}
-void TitleHelper::connectWithUntitledNumbers (const css::uno::Reference< css::frame::XUntitledNumbers >& xNumbers)
-{
- // SYNCHRONIZED ->
- osl::MutexGuard aLock(m_aMutex);
-
- m_xUntitledNumbers = xNumbers;
- // <- SYNCHRONIZED
-}
-
void SAL_CALL TitleHelper::setTitle(const OUString& sTitle)
{
// SYNCHRONIZED ->