include/vcl/weld.hxx | 35 ++++++++++++++++++++++++++++----- vcl/inc/jsdialog/jsdialogbuilder.hxx | 4 +-- vcl/inc/qt5/QtInstanceAssistant.hxx | 4 +-- vcl/inc/qt5/QtInstanceRadioButton.hxx | 2 - vcl/inc/qt5/QtInstanceToggleButton.hxx | 2 - vcl/inc/salvtables.hxx | 15 ++++---------- vcl/jsdialog/jsdialogbuilder.cxx | 8 +++---- vcl/qt5/QtInstanceAssistant.cxx | 4 +-- vcl/qt5/QtInstanceRadioButton.cxx | 2 - vcl/qt5/QtInstanceToggleButton.cxx | 2 - vcl/source/app/salvtables.cxx | 17 +++------------- vcl/unx/gtk3/gtkinst.cxx | 12 +++++------ 12 files changed, 59 insertions(+), 48 deletions(-)
New commits: commit b209c67cc403addb7aca29fb9648e7e2cc09f22a Author: Michael Weghorn <[email protected]> AuthorDate: Sat Oct 18 02:11:15 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:08:47 2025 +0200 tdf#130857 weld: Move signal blocking to Assistant::set_page_title Apply the changes as described in Change-Id: If5fba408cc6638441e9856238b19659fed6d7e01 Author: Michael Weghorn <[email protected]> Date: Fri Oct 17 22:11:02 2025 +0200 tdf#130857 weld: Move signal blocking to TextView::select_region for this method as well. See the above-mentioned commit for more details/background. Change-Id: Id46651d07878eeb5b95f0cd28a3b3b89d58bb795 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192633 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 20dfb4c0f11e..0188a945f662 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -698,6 +698,7 @@ protected: return m_aJumpPageHdl.Call(rIdent); } + virtual void do_set_page_title(const OUString& rIdent, const OUString& rTitle) = 0; virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) = 0; public: @@ -709,7 +710,14 @@ public: virtual void set_current_page(const OUString& rIdent) = 0; // move the page rIdent to position nIndex virtual void set_page_index(const OUString& rIdent, int nIndex) = 0; - virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) = 0; + + void set_page_title(const OUString& rIdent, const OUString& rTitle) + { + disable_notify_events(); + do_set_page_title(rIdent, rTitle); + enable_notify_events(); + } + virtual OUString get_page_title(const OUString& rIdent) const = 0; void set_page_sensitive(const OUString& rIdent, bool bSensitive) diff --git a/vcl/inc/qt5/QtInstanceAssistant.hxx b/vcl/inc/qt5/QtInstanceAssistant.hxx index fb323aedb83f..741ddeeed660 100644 --- a/vcl/inc/qt5/QtInstanceAssistant.hxx +++ b/vcl/inc/qt5/QtInstanceAssistant.hxx @@ -47,7 +47,7 @@ public: virtual void set_current_page(int nPage) override; virtual void set_current_page(const OUString& rIdent) override; virtual void set_page_index(const OUString& rIdent, int nIndex) override; - virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) override; + virtual void do_set_page_title(const OUString& rIdent, const OUString& rTitle) override; virtual OUString get_page_title(const OUString& rIdent) const override; virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) override; virtual weld::Container* append_page(const OUString& rIdent) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index fbfa770e93ff..2ce1d38c1c3f 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -574,7 +574,7 @@ public: virtual void set_page_index(const OUString& rIdent, int nNewIndex) override; virtual weld::Container* append_page(const OUString& rIdent) override; virtual OUString get_page_title(const OUString& rIdent) const override; - virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) override; + virtual void do_set_page_title(const OUString& rIdent, const OUString& rTitle) override; virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) override; virtual void set_page_side_help_id(const OUString& rHelpId) override; virtual void set_page_side_image(const OUString& rImage) override; diff --git a/vcl/qt5/QtInstanceAssistant.cxx b/vcl/qt5/QtInstanceAssistant.cxx index f86185beefe3..8e0db3905706 100644 --- a/vcl/qt5/QtInstanceAssistant.cxx +++ b/vcl/qt5/QtInstanceAssistant.cxx @@ -156,7 +156,7 @@ void QtInstanceAssistant::set_page_index(const OUString& rIdent, int nIndex) }); } -void QtInstanceAssistant::set_page_title(const OUString& rIdent, const OUString& rTitle) +void QtInstanceAssistant::do_set_page_title(const OUString& rIdent, const OUString& rTitle) { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a598c6ba0cc2..09db1d193b5c 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2177,17 +2177,15 @@ OUString SalInstanceAssistant::get_page_title(const OUString& rIdent) const return m_aAddedPages[nIndex]->GetText(); } -void SalInstanceAssistant::set_page_title(const OUString& rIdent, const OUString& rTitle) +void SalInstanceAssistant::do_set_page_title(const OUString& rIdent, const OUString& rTitle) { int nIndex = find_page(rIdent); if (nIndex == -1) return; if (m_aAddedPages[nIndex]->GetText() != rTitle) { - disable_notify_events(); m_aAddedPages[nIndex]->SetText(rTitle); m_aUpdateRoadmapIdle.Start(); - enable_notify_events(); } } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index d2ef220114b1..9bc449626177 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -7760,7 +7760,7 @@ public: set_current_page(nPage); } - virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) override + virtual void do_set_page_title(const OUString& rIdent, const OUString& rTitle) override { int nIndex = find_page(rIdent); if (nIndex == -1) commit c1d5ab90ec6dcbdb99fc7e61f0a7d247d68bde52 Author: Michael Weghorn <[email protected]> AuthorDate: Sat Oct 18 02:08:28 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:08:41 2025 +0200 tdf#130857 weld: Move signal blocking to Assistant::set_page_sensitive Apply the changes as described in Change-Id: If5fba408cc6638441e9856238b19659fed6d7e01 Author: Michael Weghorn <[email protected]> Date: Fri Oct 17 22:11:02 2025 +0200 tdf#130857 weld: Move signal blocking to TextView::select_region for this method as well. See the above-mentioned commit for more details/background. Change-Id: Ibe5c54a7329898df9fa0f9135357eaae239624e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192632 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index cf56a0cb4a3b..20dfb4c0f11e 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -698,6 +698,8 @@ protected: return m_aJumpPageHdl.Call(rIdent); } + virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) = 0; + public: virtual int get_current_page() const = 0; virtual int get_n_pages() const = 0; @@ -709,7 +711,14 @@ public: virtual void set_page_index(const OUString& rIdent, int nIndex) = 0; virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) = 0; virtual OUString get_page_title(const OUString& rIdent) const = 0; - virtual void set_page_sensitive(const OUString& rIdent, bool bSensitive) = 0; + + void set_page_sensitive(const OUString& rIdent, bool bSensitive) + { + disable_notify_events(); + do_set_page_sensitive(rIdent, bSensitive); + enable_notify_events(); + } + virtual weld::Container* append_page(const OUString& rIdent) = 0; virtual void set_page_side_help_id(const OUString& rHelpId) = 0; diff --git a/vcl/inc/qt5/QtInstanceAssistant.hxx b/vcl/inc/qt5/QtInstanceAssistant.hxx index 31644c2a6abe..fb323aedb83f 100644 --- a/vcl/inc/qt5/QtInstanceAssistant.hxx +++ b/vcl/inc/qt5/QtInstanceAssistant.hxx @@ -49,7 +49,7 @@ public: virtual void set_page_index(const OUString& rIdent, int nIndex) override; virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) override; virtual OUString get_page_title(const OUString& rIdent) const override; - virtual void set_page_sensitive(const OUString& rIdent, bool bSensitive) override; + virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) override; virtual weld::Container* append_page(const OUString& rIdent) override; virtual void set_page_side_help_id(const OUString& rHelpId) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 6c7c5f377ea7..fbfa770e93ff 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -575,7 +575,7 @@ public: virtual weld::Container* append_page(const OUString& rIdent) override; virtual OUString get_page_title(const OUString& rIdent) const override; virtual void set_page_title(const OUString& rIdent, const OUString& rTitle) override; - virtual void set_page_sensitive(const OUString& rIdent, bool bSensitive) override; + virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) override; virtual void set_page_side_help_id(const OUString& rHelpId) override; virtual void set_page_side_image(const OUString& rImage) override; std::unique_ptr<weld::Button> weld_button_for_response(int nResponse) override; diff --git a/vcl/qt5/QtInstanceAssistant.cxx b/vcl/qt5/QtInstanceAssistant.cxx index 92f3ddfde3d8..f86185beefe3 100644 --- a/vcl/qt5/QtInstanceAssistant.cxx +++ b/vcl/qt5/QtInstanceAssistant.cxx @@ -179,7 +179,7 @@ OUString QtInstanceAssistant::get_page_title(const OUString& rIdent) const return sTitle; } -void QtInstanceAssistant::set_page_sensitive(const OUString& rIdent, bool bSensitive) +void QtInstanceAssistant::do_set_page_sensitive(const OUString& rIdent, bool bSensitive) { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 362a54d0b186..a598c6ba0cc2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2191,17 +2191,15 @@ void SalInstanceAssistant::set_page_title(const OUString& rIdent, const OUString } } -void SalInstanceAssistant::set_page_sensitive(const OUString& rIdent, bool bSensitive) +void SalInstanceAssistant::do_set_page_sensitive(const OUString& rIdent, bool bSensitive) { int nIndex = find_page(rIdent); if (nIndex == -1) return; if (m_aAddedPages[nIndex]->IsEnabled() != bSensitive) { - disable_notify_events(); m_aAddedPages[nIndex]->Enable(bSensitive); m_aUpdateRoadmapIdle.Start(); - enable_notify_events(); } } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index bd1c3978b2da..d2ef220114b1 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -7783,7 +7783,7 @@ public: return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); } - virtual void set_page_sensitive(const OUString& rIdent, bool bSensitive) override + virtual void do_set_page_sensitive(const OUString& rIdent, bool bSensitive) override { m_aNotClickable[rIdent] = !bSensitive; } commit 6219b31998c0f8098c99db2ae57ec3097e42d727 Author: Michael Weghorn <[email protected]> AuthorDate: Sat Oct 18 02:04:28 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:08:34 2025 +0200 tdf#130857 weld: Move signal blocking to Toggleable::set_active Apply the changes as described in Change-Id: If5fba408cc6638441e9856238b19659fed6d7e01 Author: Michael Weghorn <[email protected]> Date: Fri Oct 17 22:11:02 2025 +0200 tdf#130857 weld: Move signal blocking to TextView::select_region for this method and subclass overrides as well. See the above-mentioned commit for more details/background. Change-Id: I0ba19871b59ffeae03a15e59d83618212a3e9a50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192631 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 9fcd12adb83e..cf56a0cb4a3b 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1826,8 +1826,16 @@ protected: m_aToggleHdl.Call(*this); } + virtual void do_set_active(bool active) = 0; + public: - virtual void set_active(bool active) = 0; + void set_active(bool active) + { + disable_notify_events(); + do_set_active(active); + enable_notify_events(); + } + virtual bool get_active() const = 0; virtual TriState get_state() const @@ -1914,9 +1922,9 @@ public: enable_notify_events(); } - virtual void set_active(bool bActive) override final + virtual void do_set_active(bool bActive) override final { - set_state(bActive ? TRISTATE_TRUE : TRISTATE_FALSE); + do_set_state(bActive ? TRISTATE_TRUE : TRISTATE_FALSE); } virtual bool get_active() const override final { return get_state() == TRISTATE_TRUE; } diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 4702c6dfcc0e..102459e9ae8c 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -762,7 +762,7 @@ public: JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); - virtual void set_active(bool active) override; + virtual void do_set_active(bool active) override; }; class JSFrame : public JSWidget<SalInstanceFrame, ::VclFrame> @@ -781,7 +781,7 @@ public: virtual void set_label(const OUString& rText) override; virtual void set_image(VirtualDevice* pDevice) override; virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override; - virtual void set_active(bool active) override; + virtual void do_set_active(bool active) override; }; class JSMenu final : public SalInstanceMenu diff --git a/vcl/inc/qt5/QtInstanceRadioButton.hxx b/vcl/inc/qt5/QtInstanceRadioButton.hxx index 443bffb1c5ce..334dd8a2c588 100644 --- a/vcl/inc/qt5/QtInstanceRadioButton.hxx +++ b/vcl/inc/qt5/QtInstanceRadioButton.hxx @@ -24,7 +24,7 @@ public: QtInstanceRadioButton(QRadioButton* pRadioButton); // weld::Toggleable methods - virtual void set_active(bool bActive) override; + virtual void do_set_active(bool bActive) override; virtual bool get_active() const override; // weld::RadioButton methods diff --git a/vcl/inc/qt5/QtInstanceToggleButton.hxx b/vcl/inc/qt5/QtInstanceToggleButton.hxx index ca3c89a56239..5dc1691dcaef 100644 --- a/vcl/inc/qt5/QtInstanceToggleButton.hxx +++ b/vcl/inc/qt5/QtInstanceToggleButton.hxx @@ -20,7 +20,7 @@ class QtInstanceToggleButton : public QtInstanceButton, public virtual weld::Tog public: QtInstanceToggleButton(QAbstractButton* pButton); - virtual void set_active(bool bActive) override; + virtual void do_set_active(bool bActive) override; virtual bool get_active() const override; private Q_SLOTS: diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 6611f23b3aea..6c7c5f377ea7 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1104,12 +1104,7 @@ public: weld::ToggleButton::connect_toggled(rLink); } - virtual void set_active(bool active) override - { - disable_notify_events(); - m_xToggleButton->Check(active); - enable_notify_events(); - } + virtual void do_set_active(bool active) override { m_xToggleButton->Check(active); } virtual bool get_active() const override { return m_xToggleButton->IsChecked(); } @@ -1997,7 +1992,7 @@ public: SalInstanceRadioButton(::RadioButton* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); - virtual void set_active(bool active) override; + virtual void do_set_active(bool active) override; virtual bool get_active() const override; @@ -2041,7 +2036,7 @@ protected: public: SalInstanceMenuButton(::MenuButton* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); - virtual void set_active(bool active) override; + virtual void do_set_active(bool active) override; virtual bool get_active() const override; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 8570f4d7922a..6295989285aa 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1942,9 +1942,9 @@ JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButto { } -void JSRadioButton::set_active(bool active) +void JSRadioButton::do_set_active(bool active) { - SalInstanceRadioButton::set_active(active); + SalInstanceRadioButton::do_set_active(active); sendUpdate(); } @@ -1980,9 +1980,9 @@ void JSMenuButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& sendUpdate(); } -void JSMenuButton::set_active(bool bActive) +void JSMenuButton::do_set_active(bool bActive) { - SalInstanceMenuButton::set_active(bActive); + SalInstanceMenuButton::do_set_active(bActive); VclPtr<vcl::Window> pPopup = m_xMenuButton->GetPopover(); if (pPopup) diff --git a/vcl/qt5/QtInstanceRadioButton.cxx b/vcl/qt5/QtInstanceRadioButton.cxx index 9c8ba8148535..8f9de312c6d4 100644 --- a/vcl/qt5/QtInstanceRadioButton.cxx +++ b/vcl/qt5/QtInstanceRadioButton.cxx @@ -20,7 +20,7 @@ QtInstanceRadioButton::QtInstanceRadioButton(QRadioButton* pRadioButton) connect(m_pRadioButton, &QRadioButton::toggled, this, [&] { signal_toggled(); }); } -void QtInstanceRadioButton::set_active(bool bActive) +void QtInstanceRadioButton::do_set_active(bool bActive) { SolarMutexGuard g; GetQtInstance().RunInMainThread([&] { m_pRadioButton->setChecked(bActive); }); diff --git a/vcl/qt5/QtInstanceToggleButton.cxx b/vcl/qt5/QtInstanceToggleButton.cxx index cb63c32b8fa4..05023f932e8f 100644 --- a/vcl/qt5/QtInstanceToggleButton.cxx +++ b/vcl/qt5/QtInstanceToggleButton.cxx @@ -19,7 +19,7 @@ QtInstanceToggleButton::QtInstanceToggleButton(QAbstractButton* pButton) connect(&getButton(), &QAbstractButton::toggled, this, &QtInstanceToggleButton::signalToggled); } -void QtInstanceToggleButton::set_active(bool bActive) +void QtInstanceToggleButton::do_set_active(bool bActive) { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index d08ebff06792..362a54d0b186 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2982,7 +2982,7 @@ SalInstanceMenuButton::SalInstanceMenuButton(::MenuButton* pButton, SalInstanceB } } -void SalInstanceMenuButton::set_active(bool active) +void SalInstanceMenuButton::do_set_active(bool active) { if (active == get_active()) return; @@ -3086,12 +3086,7 @@ SalInstanceRadioButton::SalInstanceRadioButton(::RadioButton* pButton, SalInstan m_xRadioButton->SetToggleHdl(LINK(this, SalInstanceRadioButton, ToggleHdl)); } -void SalInstanceRadioButton::set_active(bool active) -{ - disable_notify_events(); - m_xRadioButton->Check(active); - enable_notify_events(); -} +void SalInstanceRadioButton::do_set_active(bool active) { m_xRadioButton->Check(active); } bool SalInstanceRadioButton::get_active() const { return m_xRadioButton->IsChecked(); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 628c1517c70b..bd1c3978b2da 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -10286,7 +10286,7 @@ public: { } - virtual void set_active(bool active) override + virtual void do_set_active(bool active) override { disable_notify_events(); gtk_toggle_button_set_active(m_pToggleButton, active); @@ -10949,7 +10949,7 @@ public: m_aCustomBackground.use_custom_content(pDevice); } - virtual void set_active(bool active) override + virtual void do_set_active(bool active) override { disable_notify_events(); if (active) @@ -10979,10 +10979,10 @@ public: return GtkInstanceWidget::get_font(); } #else - virtual void set_active(bool bActive) override + virtual void do_set_active(bool bActive) override { bool bWasActive = get_active(); - GtkInstanceToggleButton::set_active(bActive); + GtkInstanceToggleButton::do_set_active(bActive); if (bWasActive && !bActive && gtk_widget_get_focus_on_click(GTK_WIDGET(m_pMenuButton))) { // grab focus back to the toggle button if the menu was popped down
