summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-20 14:48:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-20 20:54:59 +0100
commit05b62fa08b7281abaf821aedf5835fc18347d853 (patch)
tree98d15e0e3ff6c6ed3094f789b949f5c6d1135861 /sfx2
parent8579b53bc4d3056d60cc09d6c702c1caf880c3d6 (diff)
use the uno apis instead of extracting the underlying vcl::Window
Change-Id: I050df6d7f1325681adf9cf65d3e3b20fc63c2bfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112813 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/inet/inettbc.cxx23
1 files changed, 12 insertions, 11 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 <inettbc.hxx>
#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
@@ -28,7 +29,6 @@
#include <unotools/historyoptions.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/svapp.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
#include <osl/file.hxx>
#include <rtl/ustring.hxx>
@@ -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<vcl::Window> 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<css::awt::XTopWindow> xTop(xWin, UNO_QUERY);
+ if (!xTop)
+ return true;
+ xTop->toFront();
return true;
}