[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 20 19:55:37 UTC 2021


 sfx2/source/inet/inettbc.cxx |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 05b62fa08b7281abaf821aedf5835fc18347d853
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Mar 20 14:48:12 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Mar 20 20:54:59 2021 +0100

    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 at redhat.com>

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;
 }
 


More information about the Libreoffice-commits mailing list