From 001259475f82d01c59fb559f47500bc62fc7da94 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Dec 2021 14:06:15 +0000 Subject: tdf#146333 don't create a new XTitle just to remove a listener from it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seeing as the listener obviously won't be in it Change-Id: If9944c003fa51309288276f1327011dc7403b31b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127159 Tested-by: Julien Nabet Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/ui/browser/genericcontroller.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dbaccess/source') diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index e317c2a3beeb..05aabe1855fa 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1050,12 +1050,12 @@ Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() cons return xWindow; } -Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw() +Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw(bool bCreateIfNecessary) { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - if ( ! m_xTitleHelper.is ()) + if (!m_xTitleHelper.is() && bCreateIfNecessary) { Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY ); @@ -1093,7 +1093,7 @@ void SAL_CALL OGenericUnoController::addTitleChangeListener(const Reference< XTi void SAL_CALL OGenericUnoController::removeTitleChangeListener(const Reference< XTitleChangeListener >& xListener) { - Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), UNO_QUERY); + Reference< XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(false), UNO_QUERY); if (xBroadcaster.is ()) xBroadcaster->removeTitleChangeListener (xListener); } -- cgit