diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-20 14:06:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-12-20 20:37:23 +0100 |
commit | 001259475f82d01c59fb559f47500bc62fc7da94 (patch) | |
tree | ac23289bbbd8a84636266b317ea7fc78e486dd94 /dbaccess/source | |
parent | 7cf387c43562a78192a59bd8fcfeea9b67d96f09 (diff) |
tdf#146333 don't create a new XTitle just to remove a listener from it
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 <serval2412@yahoo.fr>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |