summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-16 16:14:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-17 06:43:26 +0000
commitfe48df2684aa2877b26a112b738f3756db10fa6d (patch)
tree1d6e7e16d87da01fbe74a41e7b8457cb5e110b11 /sd/source/ui
parentbd881e48f7860596096a45816c559ac100b0bf59 (diff)
XUnoTunnel->dynamic_cast in sd::framework::Pane
Change-Id: I3e6408af0b57bd3b714551c42a31b5b0aabaf3a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145640 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx13
-rw-r--r--sd/source/ui/inc/framework/Pane.hxx16
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx3
3 files changed, 5 insertions, 27 deletions
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index a188f0e11799..c128a5351f14 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -136,19 +136,6 @@ sal_Bool SAL_CALL Pane::isAnchorOnly()
return true;
}
-//----- XUnoTunnel ------------------------------------------------------------
-
-const Sequence<sal_Int8>& Pane::getUnoTunnelId()
-{
- static const comphelper::UnoIdInit thePaneUnoTunnelId;
- return thePaneUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL Pane::getSomething (const Sequence<sal_Int8>& rId)
-{
- return comphelper::getSomethingImpl(rId, this);
-}
-
Reference<rendering::XCanvas> Pane::CreateCanvas()
{
Reference<rendering::XCanvas> xCanvas;
diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx
index 9e8ee25a1f73..51b7a5ed0934 100644
--- a/sd/source/ui/inc/framework/Pane.hxx
+++ b/sd/source/ui/inc/framework/Pane.hxx
@@ -21,7 +21,6 @@
#include <com/sun/star/drawing/framework/XPane.hpp>
#include <com/sun/star/drawing/framework/XPane2.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <vcl/vclptr.hxx>
@@ -31,8 +30,7 @@ namespace sd::framework {
typedef ::cppu::WeakComponentImplHelper <
css::drawing::framework::XPane,
- css::drawing::framework::XPane2,
- css::lang::XUnoTunnel
+ css::drawing::framework::XPane2
> PaneInterfaceBase;
/** A pane is a wrapper for a window and possibly for a tab bar (for view
@@ -42,8 +40,8 @@ typedef ::cppu::WeakComponentImplHelper <
1. It implements the XPane interface. This is the most important
interface of this class for API based views (of which there not that
many yet) because it gives access to the XWindow.
- 2. It gives access to the underlying VCL Window by implementing the
- XUnoTunnel interface. This is necessary at the moment and in the
+ 2. It gives access to the underlying VCL Window.
+ This is necessary at the moment and in the
foreseeable future because many parts of the Draw and Impress views rely
on direct access on the Window class.
*/
@@ -69,9 +67,7 @@ public:
virtual void SAL_CALL disposing() override;
- static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
-
- /** This method is typically used together with the XUnoTunnel to obtain
+ /** This method is typically used to obtain
a Window pointer from an XPane object.
*/
virtual vcl::Window* GetWindow();
@@ -109,10 +105,6 @@ public:
*/
virtual sal_Bool SAL_CALL isAnchorOnly() override;
- //----- XUnoTunnel --------------------------------------------------------
-
- virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence<sal_Int8>& rId) override;
-
protected:
css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId;
VclPtr<vcl::Window> mpWindow;
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 588b55eaee8b..d9fdd2addfdf 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -185,8 +185,7 @@ vcl::Window* ViewTabBar::GetAnchorWindow(
// Tunnel through the XWindow to the VCL side.
try
{
- Reference<lang::XUnoTunnel> xTunnel (xPane, UNO_QUERY_THROW);
- if (auto pPane = comphelper::getFromUnoTunnel<framework::Pane>(xTunnel))
+ if (auto pPane = dynamic_cast<framework::Pane*>(xPane.get()))
pWindow = pPane->GetWindow()->GetParent();
}
catch (const RuntimeException&)