include/vcl/weld.hxx | 11 +- sc/uiconfig/scalc/ui/ttestdialog.ui | 185 +++++++++++++++++------------------- vcl/inc/qt5/QtInstanceTextView.hxx | 2 vcl/inc/salvtables.hxx | 2 vcl/qt5/QtInstanceBuilder.cxx | 1 vcl/qt5/QtInstanceTextView.cxx | 2 vcl/source/app/salvtables.cxx | 4 vcl/unx/gtk3/gtkinst.cxx | 2 8 files changed, 107 insertions(+), 102 deletions(-)
New commits: commit 039f89a0b91ee03b9357b2082bfe17e8769e1573 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 22:11:02 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:06:02 2025 +0200 tdf#130857 weld: Move signal blocking to TextView::select_region So far, the vcl and gtk3/gtk4 implementations have their separate implementations to avoid signalling certain widget changes when those changes are done programatically and not manually by the user, and the native qt5/qt6 implementation didn't yet implement any such logic, meaning signals would be emitted more often for supported dialogs in the SAL_VCL_QT_USE_WELDED_WIDGETS=1 case than for the gtk and vcl implementations. While emitting signals also on programmatic changes seems plausible in general and matches what e.g. the GTK and Qt toolkits do for their widgets, it would cause various dialog implementations to misbehave with the native Qt implementation as they rely on the signals not being emitted in such cases. See for example commit 3ffa3be35ee712db24ec9b2ffa55e96c3d97d169 Author: Michael Weghorn <[email protected]> Date: Tue Aug 12 13:25:15 2025 +0200 tdf#130857 cui: Refine toggle logic in "Area" tab page for one commit to adjust a dialog to work as expected when signals are emitted on programmatic changes as well. In order to unify the behavior between the different weld::Widget (and subclasses) implementations on when signals are blocked without having to duplicate the same logic in multiple places, calling the methods to block and unblock signal emission is moved from the vcl (SalInstance*) implementations to the weld::Widget (and subclasses) methods. In order to do so, introduce new helper methods to implement in the toolkit-specific implementations that implement the "actual" logic of modifying the underlying toolkit widget, and are wrapped by the weld::Widget method that first calls weld::Widget::disable_notify_events to disable signals before calling the "actual" logic, then enables signals again by calling weld::Widget::enable_notify_events. This is what the SalInstanceWidget implementation did previously. This means that the logic previously implemented in the vcl implementation now also applies for the qt5/qt6 and gtk3/gtk4 ones. As described above, the native qt5/qt6 implementation (QtInstanceWidget and subclasses) didn't have any such mechanism yet, and now gets aligned with the vcl implementation. The native gtk3/gtk4 implementation (GtkInstanceWidget and subclasses) already has its own logic to block signal emission and now gets another level of filtering signals. That should be fine, because only signals that are not emitted for the vcl version are now filtered for gtk3/gtk4 on another level as well, so dialog implementations shouldn't expect these signals. After all, the existing gtk3/gtk4 logic to filter out signals should be equivalent and presumably become mostly redundant once the current vcl one is moved to the weld::Widget base classes. It is left in place for now, however, and can/should be revisited separately on a case-by-case basis, to identify any logic that may still be relevant. This is the first commit in a series that applies the logic change described above, and does so for TextView::select_region. The same will be done for the other methods in separate upcoming commits. See also the commit messages of previous commits Change-Id: I93ec71e29804fd601e314e24c96d0f18a7cbb98c Author: Michael Weghorn <[email protected]> Date: Fri Oct 17 20:42:30 2025 +0200 tdf#130857 weld: Move signal block counter logic to weld::Widget and Change-Id: I13bb1d4a2b52b2d4494a85895f2e33b98b2c45c6 Author: Michael Weghorn <[email protected]> Date: Fri Oct 17 21:49:10 2025 +0200 tdf#130857 weld: Move logic for (not) calling signal hdls to base classes for more background. Change-Id: If5fba408cc6638441e9856238b19659fed6d7e01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192610 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 883ff09341dd..cd53b344d012 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2498,11 +2498,20 @@ protected: void signal_vadjustment_value_changed() { m_aVValueChangeHdl.Call(*this); } + virtual void do_select_region(int nStartPos, int nEndPos) = 0; + public: virtual void set_text(const OUString& rText) = 0; virtual OUString get_text() const = 0; + // if nStartPos or nEndPos is -1 the max available text pos will be used - virtual void select_region(int nStartPos, int nEndPos) = 0; + void select_region(int nStartPos, int nEndPos) + { + disable_notify_events(); + do_select_region(nStartPos, nEndPos); + enable_notify_events(); + } + // returns true if the selection has nonzero length virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0; virtual void replace_selection(const OUString& rText) = 0; diff --git a/vcl/inc/qt5/QtInstanceTextView.hxx b/vcl/inc/qt5/QtInstanceTextView.hxx index 93f527b97836..2167bc7f4ebb 100644 --- a/vcl/inc/qt5/QtInstanceTextView.hxx +++ b/vcl/inc/qt5/QtInstanceTextView.hxx @@ -24,7 +24,7 @@ public: virtual void set_text(const OUString& rText) override; virtual OUString get_text() const override; - virtual void select_region(int nStartPos, int nEndPos) override; + virtual void do_select_region(int nStartPos, int nEndPos) override; virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) override; virtual void replace_selection(const OUString& rText) override; virtual void set_editable(bool bEditable) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 2df36dcc2082..2a41cedd786d 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1428,7 +1428,7 @@ public: bool get_selection_bounds(int& rStartPos, int& rEndPos) override; - virtual void select_region(int nStartPos, int nEndPos) override; + virtual void do_select_region(int nStartPos, int nEndPos) override; virtual void set_editable(bool bEditable) override; virtual bool get_editable() const override; diff --git a/vcl/qt5/QtInstanceTextView.cxx b/vcl/qt5/QtInstanceTextView.cxx index 0846d2deaed4..6392b7d34bdf 100644 --- a/vcl/qt5/QtInstanceTextView.cxx +++ b/vcl/qt5/QtInstanceTextView.cxx @@ -45,7 +45,7 @@ OUString QtInstanceTextView::get_text() const return sText; } -void QtInstanceTextView::select_region(int nStartPos, int nEndPos) +void QtInstanceTextView::do_select_region(int nStartPos, int nEndPos) { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4d6a2f9f1f2d..d14767c744ba 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5973,13 +5973,11 @@ bool SalInstanceTextView::get_selection_bounds(int& rStartPos, int& rEndPos) return rSelection.Len(); } -void SalInstanceTextView::select_region(int nStartPos, int nEndPos) +void SalInstanceTextView::do_select_region(int nStartPos, int nEndPos) { - disable_notify_events(); tools::Long nStart = nStartPos < 0 ? SELECTION_MAX : nStartPos; tools::Long nEnd = nEndPos < 0 ? SELECTION_MAX : nEndPos; m_xTextView->SetSelection(Selection(nStart, nEnd)); - enable_notify_events(); } void SalInstanceTextView::set_editable(bool bEditable) { m_xTextView->SetReadOnly(!bEditable); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 8de594dc7f6a..af1de02707e7 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -18076,7 +18076,7 @@ public: return rStartPos != rEndPos; } - virtual void select_region(int nStartPos, int nEndPos) override + virtual void do_select_region(int nStartPos, int nEndPos) override { disable_notify_events(); GtkTextIter start, end; commit d24e74b16b728ebca060bd5349cba945a55a018b Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 17:57:17 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:05:55 2025 +0200 tdf#130857 qt weld: Support Calc "F-Test" 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 Calc using "Data" -> "Statistics" -> "F-Test". Change-Id: I3b9d11a0b55792272e3dd630b3d8aa3180aec1c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192588 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 23206eb47a66..0d44afc9c867 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -145,6 +145,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"modules/scalc/ui/selectsource.ui"_ustr, u"modules/scalc/ui/showsheetdialog.ui"_ustr, u"modules/scalc/ui/sortdialog.ui"_ustr, + u"modules/scalc/ui/ttestdialog.ui"_ustr, u"modules/schart/ui/insertaxisdlg.ui"_ustr, u"modules/sdraw/ui/dlgsnap.ui"_ustr, u"modules/sdraw/ui/insertlayer.ui"_ustr, commit 97724982d599fb7663becdb8ec55fce127a5780c Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 17:54:28 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:05:48 2025 +0200 sc: Resave ttestdialog.ui with glade 3.40 This file is used for the "F-test" dialog in Calc that can be triggered using "Data" -> "Statistics" -> "F-Test". Change-Id: Ida816061157e223949f540f4f365fc572efb2e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192587 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sc/uiconfig/scalc/ui/ttestdialog.ui b/sc/uiconfig/scalc/ui/ttestdialog.ui index c8e3593dff20..580dbc967f7d 100644 --- a/sc/uiconfig/scalc/ui/ttestdialog.ui +++ b/sc/uiconfig/scalc/ui/ttestdialog.ui @@ -1,30 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.40.0 --> <interface domain="sc"> <requires lib="gtk+" version="3.20"/> <object class="GtkDialog" id="TTestDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> + <property name="default-width">0</property> + <property name="default-height">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -37,9 +37,9 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -52,8 +52,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -67,145 +67,145 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkFrame" id="frame-data"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=3 n-rows=3 --> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> + <property name="margin-end">12</property> <property name="margin-top">6</property> <property name="margin-bottom">6</property> - <property name="margin-end">12</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="variable1-range-label"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ttestdialog|variable1-range-label">Variable 1 range:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">variable1-range-edit</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">variable1-range-edit</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkEntry" id="variable1-range-edit"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> + <property name="width-chars">30</property> <property name="truncate-multiline">True</property> - <property name="width_chars">30</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkButton" id="variable1-range-button"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> </object> <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> + <property name="left-attach">2</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="variable2-range-label"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ttestdialog|variable2-range-label">Variable 2 range:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">variable2-range-edit</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">variable2-range-edit</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkEntry" id="variable2-range-edit"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> + <property name="width-chars">30</property> <property name="truncate-multiline">True</property> - <property name="width_chars">30</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkButton" id="variable2-range-button"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> </object> <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> + <property name="left-attach">2</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkLabel" id="output-range-label"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ttestdialog|output-range-label">Results to:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">output-range-edit</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">output-range-edit</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkEntry" id="output-range-edit"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> - <property name="activates_default">True</property> + <property name="activates-default">True</property> + <property name="width-chars">30</property> <property name="truncate-multiline">True</property> - <property name="width_chars">30</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="left-attach">1</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkButton" id="output-range-button"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> </object> <packing> - <property name="left_attach">2</property> - <property name="top_attach">2</property> + <property name="left-attach">2</property> + <property name="top-attach">2</property> </packing> </child> </object> @@ -213,7 +213,7 @@ <child type="label"> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ttestdialog|label1">Data</property> <attributes> <attribute name="weight" value="bold"/> @@ -230,48 +230,48 @@ <child> <object class="GtkFrame" id="frame2"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=1 --> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> + <property name="margin-end">12</property> <property name="margin-top">6</property> <property name="margin-bottom">6</property> - <property name="margin-end">12</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkRadioButton" id="groupedby-columns-radio"> <property name="label" translatable="yes" context="ttestdialog|groupedby-columns-radio">Columns</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> <property name="active">True</property> - <property name="draw_indicator">True</property> + <property name="draw-indicator">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkRadioButton" id="groupedby-rows-radio"> <property name="label" translatable="yes" context="ttestdialog|groupedby-rows-radio">Rows</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> <property name="group">groupedby-columns-radio</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> </object> @@ -279,7 +279,7 @@ <child type="label"> <object class="GtkLabel" id="label2"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="ttestdialog|label2">Grouped by</property> <attributes> <attribute name="weight" value="bold"/> @@ -300,9 +300,6 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> - <child type="titlebar"> - <placeholder/> - </child> <child internal-child="accessible"> <object class="AtkObject" id="TTestDialog-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="ttestdialog|extended_tip|TTestDialog">Calculates the paired t-Test of two data samples.</property>
