summaryrefslogtreecommitdiff
path: root/framework
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
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')
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx26
-rw-r--r--framework/source/services/frame.cxx4
2 files changed, 9 insertions, 21 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 ->
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index db26f59aec0b..ac9ee29c6cdf 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -817,9 +817,7 @@ void SAL_CALL XFrameImpl::initialize( const css::uno::Reference< css::awt::XWind
m_pWindowCommandDispatch.reset(new WindowCommandDispatch(m_xContext, this));
// Initialize title functionality
- rtl::Reference<TitleHelper> pTitleHelper = new TitleHelper( m_xContext );
- m_xTitleHelper = pTitleHelper;
- pTitleHelper->setOwner(xThis);
+ m_xTitleHelper = new TitleHelper( m_xContext, xThis, nullptr );
}
/*-****************************************************************************************************