From 05b62fa08b7281abaf821aedf5835fc18347d853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 20 Mar 2021 14:48:12 +0000 Subject: [PATCH] use the uno apis instead of extracting the underlying vcl::Window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I050df6d7f1325681adf9cf65d3e3b20fc63c2bfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112813 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/inet/inettbc.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 5d8bd6c5bb7c..6027819ede7f 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include #include #include @@ -203,16 +203,17 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl, weld::ComboBox&, bool) Reference< XDesktop2 > xDesktop = Desktop::create( m_xContext ); Reference< XFrame > xFrame = xDesktop->getActiveFrame(); - if ( xFrame.is() ) - { - VclPtr pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - if ( pWin ) - { - pWin->GrabFocus(); - pWin->ToTop( ToTopFlags::RestoreWhenMin ); - } - } + if (!xFrame.is()) + return true; + auto xWin = xFrame->getContainerWindow(); + if (!xWin) + return true; + xWin->setFocus(); + Reference xTop(xWin, UNO_QUERY); + if (!xTop) + return true; + xTop->toFront(); return true; }