summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-12 15:07:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-12 19:57:24 +0200
commitf7a86c5cdf4323c99d26512bf78de7f7c380667d (patch)
treef299cbf4ca27b5db0e81a90cc6551469fa280e63 /basctl
parentc5e5467f6a13aba68b4706a4d7feb130e824bcc6 (diff)
simplify the vcl<->toolkit connection
No need to store two different pointers and hide the underlying class behind an UNO interface Change-Id: I72c55e912caa9eae1cffa6c9d1b1d480e5668d40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/accessibility/accessibledialogcontrolshape.cxx2
-rw-r--r--basctl/source/accessibility/accessibledialogwindow.cxx2
-rw-r--r--basctl/source/basicide/baside2.hxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx9
-rw-r--r--basctl/source/basicide/textwindowpeer.cxx2
-rw-r--r--basctl/source/basicide/textwindowpeer.hxx9
6 files changed, 11 insertions, 15 deletions
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index f885ff4bda1b..b61385f6671a 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -495,7 +495,7 @@ Reference< awt::XFont > AccessibleDialogControlShape::getFont( )
vcl::Window* pWindow = GetWindow();
if ( pWindow )
{
- Reference< awt::XDevice > xDev( pWindow->GetComponentInterface(), UNO_QUERY );
+ auto xDev = pWindow->GetComponentInterfaceAs<awt::XDevice>();
if ( xDev.is() )
{
vcl::Font aFont;
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 0b641c8aca5e..b91e48262a73 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -790,7 +790,7 @@ Reference< awt::XFont > AccessibleDialogWindow::getFont( )
Reference< awt::XFont > xFont;
if ( m_pDialogWindow )
{
- Reference< awt::XDevice > xDev( m_pDialogWindow->GetComponentInterface(), UNO_QUERY );
+ auto xDev = m_pDialogWindow->GetComponentInterfaceAs<awt::XDevice>();
if ( xDev.is() )
{
vcl::Font aFont;
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 06045356bccb..fd17b340ca54 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -100,7 +100,7 @@ private:
bool bDoSyntaxHighlight;
bool bDelayHighlight;
- virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate = true) override;
+ virtual VCLXWindow* GetComponentInterface(bool bCreate = true) override;
CodeCompleteDataCache aCodeCompleteCache;
VclPtr<CodeCompleteWindow> pCodeCompleteWnd;
OUString GetActualSubName( sal_uLong nLine ); // gets the actual subroutine name according to line number
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index ecba2d5fa873..3168f5090532 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2040,11 +2040,10 @@ void ComplexEditorWindow::SetLineNumberDisplay(bool b)
Resize();
}
-uno::Reference< awt::XWindowPeer >
+VCLXWindow*
EditorWindow::GetComponentInterface(bool bCreate)
{
- uno::Reference< awt::XWindowPeer > xPeer(
- Window::GetComponentInterface(false));
+ rtl::Reference< VCLXWindow > xPeer = Window::GetComponentInterface(false);
if (!xPeer.is() && bCreate)
{
// Make sure edit engine and view are available:
@@ -2052,9 +2051,9 @@ EditorWindow::GetComponentInterface(bool bCreate)
CreateEditEngine();
xPeer = createTextWindowPeer(*GetEditView());
- SetComponentInterface(xPeer);
+ SetComponentInterface(xPeer.get());
}
- return xPeer;
+ return xPeer.get();
}
static sal_uInt32 getCorrectedPropCount(SbxArray* p)
diff --git a/basctl/source/basicide/textwindowpeer.cxx b/basctl/source/basicide/textwindowpeer.cxx
index fc458453778b..cbe9781fce90 100644
--- a/basctl/source/basicide/textwindowpeer.cxx
+++ b/basctl/source/basicide/textwindowpeer.cxx
@@ -62,7 +62,7 @@ TextWindowPeer::CreateAccessibleContext() {
}
-css::uno::Reference<css::awt::XWindowPeer> basctl::createTextWindowPeer(
+rtl::Reference<VCLXWindow> basctl::createTextWindowPeer(
TextView & view)
{
return new TextWindowPeer(view);
diff --git a/basctl/source/basicide/textwindowpeer.hxx b/basctl/source/basicide/textwindowpeer.hxx
index 077ad32cd79f..701c134c3a5f 100644
--- a/basctl/source/basicide/textwindowpeer.hxx
+++ b/basctl/source/basicide/textwindowpeer.hxx
@@ -21,17 +21,14 @@
#include <sal/config.h>
-#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ref.hxx>
-namespace com::sun::star::awt
-{
-class XWindowPeer;
-}
+class VCLXWindow;
class TextView;
namespace basctl
{
-css::uno::Reference<css::awt::XWindowPeer> createTextWindowPeer(TextView& view);
+rtl::Reference<VCLXWindow> createTextWindowPeer(TextView& view);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */