include/vcl/weld.hxx | 4 ++-- vcl/inc/qt5/QtInstanceWindow.hxx | 2 -- vcl/inc/salvtables.hxx | 4 ---- vcl/qt5/QtInstanceBuilder.cxx | 1 + vcl/qt5/QtInstanceWindow.cxx | 4 ---- vcl/source/app/salvtables.cxx | 4 ---- vcl/unx/gtk3/gtkinst.cxx | 17 ++++++----------- 7 files changed, 9 insertions(+), 27 deletions(-)
New commits: commit aae76f4df1d4a554fa16c05a28d2e1d10ea558af Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Nov 7 23:30:59 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Nov 8 08:39:45 2024 +0100 tdf#130857 vcl: Move weld::Window::{g,s}et_modal to weld::Dialog All calls to get_modal and set_modal are done for weld::Dialog instances, never for plain instances of/pointers to the weld::Window base class. Therefore, drop the methods from weld::Window and add them weld::Dialog instead. SalInstanceDialog was already overriding the SalInstanceWindow implementations of both methods. For QtInstanceWindow, these were not implemented yet, while QtInstanceDialog already has implementations. (If there were a real need, they could be implemented using QWidget::isModal/QWidget::windowModality and QWidget::setWindowModality.) For GTK, move the GtkInstanceWindow::get_modal implementation to GtkInstanceDialog and call gtk_window_set_modal directly instead of GtkInstanceWindow::set_modal in GtkInstanceDialog::set_modal. Change-Id: I71431347f3bca9571c6fd4b7cf995bb79fb5b11d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176252 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index cc60c8f351e7..cc338544fe3f 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -539,8 +539,6 @@ public: virtual void set_title(const OUString& rTitle) = 0; virtual OUString get_title() const = 0; virtual void window_move(int x, int y) = 0; - virtual void set_modal(bool bModal) = 0; - virtual bool get_modal() const = 0; virtual bool get_resizable() const = 0; virtual Size get_size() const = 0; virtual Point get_position() const = 0; @@ -617,6 +615,8 @@ private: = 0; public: + virtual void set_modal(bool bModal) = 0; + virtual bool get_modal() const = 0; virtual int run() = 0; // Run async without a controller // @param self - must point to this, to enforce that the dialog was created/held by a shared_ptr diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx index db80a6e71458..e84a6071b3f0 100644 --- a/vcl/inc/qt5/QtInstanceWindow.hxx +++ b/vcl/inc/qt5/QtInstanceWindow.hxx @@ -19,8 +19,6 @@ public: virtual void set_title(const OUString& rTitle) override; virtual OUString get_title() const override; virtual void window_move(int, int) override; - virtual void set_modal(bool) override; - virtual bool get_modal() const override; virtual bool get_resizable() const override; virtual Size get_size() const override; virtual Point get_position() const override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index f7e577ab7808..b42a3f71ebc2 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -475,10 +475,6 @@ public: virtual void resize_to_request() override; - virtual void set_modal(bool bModal) override; - - virtual bool get_modal() const override; - virtual void window_move(int x, int y) override; virtual Size get_size() const override; diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx index a915dd373131..a3c6b3de3687 100644 --- a/vcl/qt5/QtInstanceWindow.cxx +++ b/vcl/qt5/QtInstanceWindow.cxx @@ -45,10 +45,6 @@ OUString QtInstanceWindow::get_title() const void QtInstanceWindow::window_move(int, int) {} -void QtInstanceWindow::set_modal(bool) {} - -bool QtInstanceWindow::get_modal() const { return true; } - bool QtInstanceWindow::get_resizable() const { return true; } Size QtInstanceWindow::get_size() const { return Size(); } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 256586f6b732..d394c462bc61 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1616,10 +1616,6 @@ void resize_to_request(vcl::Window* pWindow) void SalInstanceWindow::resize_to_request() { ::resize_to_request(m_xWindow.get()); } -void SalInstanceWindow::set_modal(bool bModal) { m_xWindow->ImplGetFrame()->SetModal(bModal); } - -bool SalInstanceWindow::get_modal() const { return m_xWindow->ImplGetFrame()->GetModal(); } - void SalInstanceWindow::window_move(int x, int y) { m_xWindow->SetPosPixel(Point(x, y)); } Size SalInstanceWindow::get_size() const { return m_xWindow->GetSizePixel(); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 2d7613bb010e..221a580457ab 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -6349,16 +6349,6 @@ public: return m_xWindow; } - virtual void set_modal(bool bModal) override - { - gtk_window_set_modal(m_pWindow, bModal); - } - - virtual bool get_modal() const override - { - return gtk_window_get_modal(m_pWindow); - } - virtual void resize_to_request() override { #if GTK_CHECK_VERSION(4, 0, 0) @@ -7144,7 +7134,7 @@ public: { if (get_modal() == bModal) return; - GtkInstanceWindow::set_modal(bModal); + gtk_window_set_modal(m_pDialog, bModal); /* if change the dialog modality while its running, then also change the parent LibreOffice window modal count, we typically expect the dialog modality to be restored to its original state @@ -7168,6 +7158,11 @@ public: } } + virtual bool get_modal() const override + { + return gtk_window_get_modal(m_pDialog); + } + virtual void response(int nResponse) override; virtual void add_button(const OUString& rText, int nResponse, const OUString& rHelpId) override commit 7ede3b80bc9ce7c99637f4d2bbc9662cf1b77b65 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Nov 7 22:33:30 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Nov 8 08:39:36 2024 +0100 tdf#130857 qt weld: Support Calc "Insert Cells" dialog Declare support for Calc's "Sheet" -> "Insert Cells..." 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. Change-Id: I73e514785d6e645f3c3a59a154eeb64e2b308418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176250 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 5612c27c7c8a..957645896c1f 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -52,6 +52,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile) u"cui/ui/securityoptionsdialog.ui"_ustr, u"cui/ui/tipofthedaydialog.ui"_ustr, u"modules/scalc/ui/inputstringdialog.ui"_ustr, + u"modules/scalc/ui/insertcells.ui"_ustr, u"modules/scalc/ui/selectsource.ui"_ustr, u"modules/schart/ui/insertaxisdlg.ui"_ustr, u"modules/smath/ui/alignmentdialog.ui"_ustr,