filter/uiconfig/ui/xmlfiltersettings.ui |    1 +
 include/sfx2/shell.hxx                  |    2 +-
 sfx2/source/control/shell.cxx           |   19 +++++++++++++++++++
 vcl/qt5/QtInstanceBuilder.cxx           |    1 +
 4 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 485a87fd4836593be4ec5b2ab0c8e7bf27f1c10f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Feb 22 14:05:01 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Feb 23 10:14:17 2025 +0100

    Make "XML Filter Settings" dialog modal and set parent
    
    So far, the "Tools" -> "XML Filter Settings" dialog
    did not have a parent and was not modal.
    
    As a consequence (tested on Plasma Wayland):
    
    * With qt6 or gen, the dialog would just "disappear" behind
      the main Writer window when clicking on the main Writer window
      or moving focus there using Alt+Tab.
    * With gtk3, the dialog would always stay on top of the Writer
      window, but would still allow to interact with the Writer window,
      so when typing text, the cursor could easily move to be behind
      the dialog.
    
    Make the dialog modal and set a parent (using
    XMLFilterDialogComponent::initialize) , which makes the dialog
    consistently appear on top of the Writer main window and the
    Writer window insensitive/disabled until the dialog gets closed again.
    
    Change-Id: I79ebc20cc3c059f217de9a1a909a7c7a424ab5ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182034
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/filter/uiconfig/ui/xmlfiltersettings.ui 
b/filter/uiconfig/ui/xmlfiltersettings.ui
index 42341d55cf9a..56524d114f0f 100644
--- a/filter/uiconfig/ui/xmlfiltersettings.ui
+++ b/filter/uiconfig/ui/xmlfiltersettings.ui
@@ -17,6 +17,7 @@
     <property name="border-width">6</property>
     <property name="title" translatable="yes" 
context="xmlfiltersettings|XMLFilterSettingsDialog">XML Filter 
Settings</property>
     <property name="resizable">False</property>
+    <property name="modal">True</property>
     <property name="default-width">0</property>
     <property name="default-height">0</property>
     <property name="type-hint">dialog</property>
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index 566241c6db7e..4bb6b01b759e 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -154,7 +154,7 @@ protected:
 
     void SetViewShell_Impl( SfxViewShell* pView );
     SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 
nId );
-    static void HandleOpenXmlFilterSettings(SfxRequest &);
+    void HandleOpenXmlFilterSettings(SfxRequest &);
 
 public:
 
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index f5899ecccc36..e6edffbbb2fa 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -19,6 +19,7 @@
 
 #include <com/sun/star/embed/VerbDescriptor.hpp>
 #include <com/sun/star/embed/VerbAttributes.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
 #include <officecfg/Office/Common.hxx>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
@@ -30,6 +31,7 @@
 #include <svtools/asynclink.hxx>
 #include <unotools/configmgr.hxx>
 #include <comphelper/lok.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <sfx2/shell.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/dispatch.hxx>
@@ -42,6 +44,7 @@
 #include <statcach.hxx>
 #include <sidebar/ContextChangeBroadcaster.hxx>
 #include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
+#include <toolkit/helper/vclunohelper.hxx>
 #include <tools/debug.hxx>
 
 #include <memory>
@@ -281,6 +284,22 @@ void SfxShell::HandleOpenXmlFilterSettings(SfxRequest & 
rReq)
     try
     {
         uno::Reference < ui::dialogs::XExecutableDialog > xDialog = 
ui::dialogs::XSLTFilterDialog::create( 
::comphelper::getProcessComponentContext() );
+
+        // set dialog parent
+        css::uno::Reference<com::sun::star::lang::XInitialization> 
xInit(xDialog,
+                                                                         
css::uno::UNO_QUERY);
+        if (xInit.is())
+        {
+            if (SfxViewShell* pViewShell = GetViewShell())
+            {
+                css::uno::Reference<css::awt::XWindow> xDialogParent
+                    = VCLUnoHelper::GetInterface(pViewShell->GetWindow());
+                css::uno::Sequence<css::uno::Any> 
aSeq(comphelper::InitAnyPropertySequence(
+                    { { "ParentWindow", uno::Any(xDialogParent) } }));
+                xInit->initialize(aSeq);
+            }
+        }
+
         (void)xDialog->execute();
     }
     catch (const uno::Exception&)
commit 0d291789e10ea070b30c3a2fa603d890961f686e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Feb 22 13:18:33 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Feb 23 10:14:07 2025 +0100

    tdf#130857 qt weld: Support "XML Filter Settings" dialog
    
    This means that native Qt widgets are used for that dialog
    now when using the qt5 or qt6 VCL plugin and starting LO with
    environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
    
    The dialog can be triggered in Writer via
    "Tools" -> "XML Filter Settings".
    
    Change-Id: Ibfb299cb746a35630bb4930789f93c73bcda1eda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182033
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 6563e84d7d52..5772b5d5cb63 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -86,6 +86,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
         u"filter/ui/testxmlfilter.ui"_ustr,
         u"filter/ui/xmlfiltertabpagegeneral.ui"_ustr,
         u"filter/ui/xmlfiltertabpagetransformation.ui"_ustr,
+        u"filter/ui/xmlfiltersettings.ui"_ustr,
         u"filter/ui/xsltfilterdialog.ui"_ustr,
         u"modules/scalc/ui/inputstringdialog.ui"_ustr,
         u"modules/scalc/ui/insertcells.ui"_ustr,

Reply via email to