summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-14 20:04:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-16 15:40:24 +0000
commit557615d97473dd4faea0914a8064d8525963fe5c (patch)
tree661469502532e8d2cffc459a014c1be02d92f0fc /framework/source
parentef52648227557461bcc1224a5af6eaebce2faae7 (diff)
Use rtl::Reference to avoid a dynamic_cast
Change-Id: I3b9781cf00df7b740c8b29c6834e54035b255269 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144327 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/services/frame.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 3721f8e40462..54df1a7eeac2 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -71,6 +71,7 @@
#include <comphelper/multicontainer2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
+#include <rtl/ref.hxx>
#include <sal/log.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
@@ -374,7 +375,7 @@ private:
/// points to an external set progress, which should be used instead of the internal one.
css::uno::WeakReference< css::task::XStatusIndicator > m_xIndicatorInterception;
/// helper for XDispatch/Provider and interception interfaces
- css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper;
+ rtl::Reference< InterceptionHelper > m_xDispatchHelper;
/// helper for XFrames, XIndexAccess and XElementAccess interfaces
css::uno::Reference< css::frame::XFrames > m_xFramesHelper;
/// container for ALL Listener
@@ -1474,10 +1475,9 @@ sal_Bool SAL_CALL XFrameImpl::setComponent(const css::uno::Reference< css::awt::
SolarMutexGuard aWriteLock;
m_xController = nullptr;
- auto pInterceptionHelper = dynamic_cast<InterceptionHelper*>(m_xDispatchHelper.get());
- if (pInterceptionHelper)
+ if (m_xDispatchHelper)
{
- rtl::Reference<DispatchProvider> pDispatchProvider = pInterceptionHelper->GetSlave();
+ rtl::Reference<DispatchProvider> pDispatchProvider = m_xDispatchHelper->GetSlave();
if (pDispatchProvider)
{
pDispatchProvider->ClearProtocolHandlers();
@@ -2117,7 +2117,7 @@ void SAL_CALL XFrameImpl::disposing()
css::uno::Reference< css::lang::XEventListener > xDispatchHelper;
{
SolarMutexGuard g;
- xDispatchHelper.set(m_xDispatchHelper, css::uno::UNO_QUERY_THROW);
+ xDispatchHelper = m_xDispatchHelper;
}
xDispatchHelper->disposing(aEvent);
xDispatchHelper.clear();
@@ -2383,7 +2383,7 @@ void SAL_CALL XFrameImpl::registerDispatchProviderInterceptor(
css::uno::Reference< css::frame::XDispatchProviderInterception > xInterceptionHelper;
{
SolarMutexGuard g;
- xInterceptionHelper.set( m_xDispatchHelper, css::uno::UNO_QUERY );
+ xInterceptionHelper = m_xDispatchHelper;
}
if (xInterceptionHelper.is()) {
xInterceptionHelper->registerDispatchProviderInterceptor( xInterceptor );
@@ -2402,7 +2402,7 @@ void SAL_CALL XFrameImpl::releaseDispatchProviderInterceptor(
css::uno::Reference< css::frame::XDispatchProviderInterception > xInterceptionHelper;
{
SolarMutexGuard g;
- xInterceptionHelper.set( m_xDispatchHelper, css::uno::UNO_QUERY );
+ xInterceptionHelper = m_xDispatchHelper;
}
if (xInterceptionHelper.is()) {
xInterceptionHelper->releaseDispatchProviderInterceptor( xInterceptor );