summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-13 10:51:31 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-23 22:57:07 +0000
commit4cfcc9ac37b90ce64c8402a41eb4638adb185b5c (patch)
tree88a473f2315c574f0a52657e2dd325e243b8f4b8 /framework
parent03efbf72f4ddf7a84aa8aabef348331bd4b75e8a (diff)
loplugin:unocast (framework::Desktop)
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: Ifcf713b0543e78a124f613bcbda496069a280dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144762 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/services/desktop.cxx10
-rw-r--r--framework/source/services/sessionlistener.cxx3
2 files changed, 12 insertions, 1 deletions
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 048b677c9daa..d58eaa9334c7 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -50,6 +50,7 @@
#include <comphelper/numberedcollection.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/lok.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <utility>
#include <vcl/svapp.hxx>
@@ -335,6 +336,15 @@ void Desktop::shutdown()
xSfxTerminator->notifyTermination(aEvent);
}
+sal_Int64 Desktop::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
+ return comphelper::getSomethingImpl(aIdentifier, this);
+}
+
+css::uno::Sequence<sal_Int8> const & Desktop::getUnoTunnelId() {
+ static comphelper::UnoIdInit const id;
+ return id.getSeq();
+}
+
namespace
{
class QuickstartSuppressor
diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx
index 188b082fe94c..01c8218b087d 100644
--- a/framework/source/services/sessionlistener.cxx
+++ b/framework/source/services/sessionlistener.cxx
@@ -23,6 +23,7 @@
#include <framework/desktop.hxx>
#include <comphelper/diagnose_ex.hxx>
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/theAutoRecovery.hpp>
@@ -342,7 +343,7 @@ void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted
css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( m_xContext );
// honestly: how many implementations of XDesktop will we ever have?
// so casting this directly to the implementation
- Desktop* pDesktop(dynamic_cast<Desktop*>(xDesktop.get()));
+ Desktop* pDesktop(comphelper::getFromUnoTunnel<Desktop>(xDesktop));
if(pDesktop)
{
SAL_INFO("fwk.session", " XDesktop is a framework::Desktop -- good.");