include/vcl/weld.hxx | 28 +++++++++++++++++++++++++--- vcl/inc/jsdialog/jsdialogbuilder.hxx | 2 +- vcl/inc/qt5/QtInstanceIconView.hxx | 6 +++--- vcl/inc/salvtables.hxx | 6 +++--- vcl/jsdialog/jsdialogbuilder.cxx | 4 ++-- vcl/qt5/QtInstanceIconView.cxx | 6 +++--- vcl/source/app/salvtables.cxx | 12 +++--------- vcl/unx/gtk3/gtkinst.cxx | 6 +++--- 8 files changed, 43 insertions(+), 27 deletions(-)
New commits: commit 21206514e8b60daa6e4de8575b3d36999813c4c3 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 22:31:41 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:06:43 2025 +0200 tdf#130857 weld: Move signal blocking to IconView::scroll_to_item 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: Ia423c2d02bdaedf735b9a801989046cdc8e090e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192616 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 7f14e29f5fa1..e13106ba8bd3 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1511,6 +1511,7 @@ protected: virtual void do_clear() = 0; virtual void do_remove(int pos) = 0; + virtual void do_scroll_to_item(const TreeIter& rIter) = 0; public: virtual int get_item_width() const = 0; @@ -1604,7 +1605,13 @@ public: virtual OUString get_id(const TreeIter& rIter) const = 0; virtual OUString get_text(const TreeIter& rIter) const = 0; virtual bool iter_next_sibling(TreeIter& rIter) const = 0; - virtual void scroll_to_item(const TreeIter& rIter) = 0; + + void scroll_to_item(const TreeIter& rIter) + { + disable_notify_events(); + do_scroll_to_item(rIter); + enable_notify_events(); + } // call func on each selected element until func returns true or we run out of elements virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) = 0; diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx b/vcl/inc/qt5/QtInstanceIconView.hxx index 5d490cd5cdb0..bda0cf297eda 100644 --- a/vcl/inc/qt5/QtInstanceIconView.hxx +++ b/vcl/inc/qt5/QtInstanceIconView.hxx @@ -63,7 +63,7 @@ public: virtual OUString get_id(const weld::TreeIter& rIter) const override; virtual OUString get_text(const weld::TreeIter& rIter) const override; virtual bool iter_next_sibling(weld::TreeIter& rIter) const override; - virtual void scroll_to_item(const weld::TreeIter& rIter) override; + virtual void do_scroll_to_item(const weld::TreeIter& rIter) override; virtual void selected_foreach(const std::function<bool(weld::TreeIter&)>& func) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 82be422ab898..f495e0ea23e1 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1957,7 +1957,7 @@ public: virtual bool iter_next_sibling(weld::TreeIter& rIter) const override; - virtual void scroll_to_item(const weld::TreeIter& rIter) override; + virtual void do_scroll_to_item(const weld::TreeIter& rIter) override; virtual void selected_foreach(const std::function<bool(weld::TreeIter&)>& func) override; diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx index af48ecb68095..1c94f2feca1e 100644 --- a/vcl/qt5/QtInstanceIconView.cxx +++ b/vcl/qt5/QtInstanceIconView.cxx @@ -276,7 +276,7 @@ bool QtInstanceIconView::iter_next_sibling(weld::TreeIter&) const return false; } -void QtInstanceIconView::scroll_to_item(const weld::TreeIter& rIter) +void QtInstanceIconView::do_scroll_to_item(const weld::TreeIter& rIter) { SolarMutexGuard g; GetQtInstance().RunInMainThread([&] { m_pListView->scrollTo(modelIndex(rIter)); }); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index edb3fd9b63e9..5efef0bd47e8 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5541,15 +5541,13 @@ bool SalInstanceIconView::iter_next_sibling(weld::TreeIter& rIter) const return rVclIter.iter != nullptr; } -void SalInstanceIconView::scroll_to_item(const weld::TreeIter& rIter) +void SalInstanceIconView::do_scroll_to_item(const weld::TreeIter& rIter) { assert(m_xIconView->IsUpdateMode() && "don't select when frozen, select after thaw. Note selection doesn't survive a " "freeze"); - disable_notify_events(); const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter); m_xIconView->MakeVisible(rVclIter.iter); - enable_notify_events(); } void SalInstanceIconView::selected_foreach(const std::function<bool(weld::TreeIter&)>& func) diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 20f27fad6c8b..d846cf208de3 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -17267,7 +17267,7 @@ public: return gtk_tree_model_iter_next(pModel, &rGtkIter.iter); } - virtual void scroll_to_item(const weld::TreeIter& rIter) override + virtual void do_scroll_to_item(const weld::TreeIter& rIter) override { assert(gtk_icon_view_get_model(m_pIconView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"); disable_notify_events(); commit ab1a6d6018cba9d6d30698aeac7aeeb09603139b Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 22:28:15 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:06:36 2025 +0200 tdf#130857 weld: Move signal blocking to IconView::do_remove 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: Ifd4793f35e0a6222ae9c6af55579309b6c05332a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192615 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 293a7ff82e1c..7f14e29f5fa1 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1510,6 +1510,7 @@ protected: } virtual void do_clear() = 0; + virtual void do_remove(int pos) = 0; public: virtual int get_item_width() const = 0; @@ -1584,7 +1585,14 @@ public: virtual void set_text(int pos, const OUString& rText) = 0; virtual void set_id(int pos, const OUString& rId) = 0; virtual void set_item_accessible_name(int pos, const OUString& rName) = 0; - virtual void remove(int pos) = 0; + + void remove(int pos) + { + disable_notify_events(); + do_remove(pos); + enable_notify_events(); + } + virtual tools::Rectangle get_rect(int pos) const = 0; //via iter diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx b/vcl/inc/qt5/QtInstanceIconView.hxx index e3b6e704d4b9..5d490cd5cdb0 100644 --- a/vcl/inc/qt5/QtInstanceIconView.hxx +++ b/vcl/inc/qt5/QtInstanceIconView.hxx @@ -51,7 +51,7 @@ public: virtual void set_text(int nPos, const OUString& rText) override; virtual void set_id(int nPos, const OUString& rId) override; virtual void set_item_accessible_name(int nPos, const OUString& rName) override; - virtual void remove(int pos) override; + virtual void do_remove(int pos) override; virtual tools::Rectangle get_rect(int pos) const override; virtual std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pOrig diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index d5f9e7cffb5e..82be422ab898 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1965,7 +1965,7 @@ public: virtual OUString get_id(int pos) const override; - virtual void remove(int pos) override; + virtual void do_remove(int pos) override; const OUString* getEntryData(int index) const; diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx index 0986e9987678..af48ecb68095 100644 --- a/vcl/qt5/QtInstanceIconView.cxx +++ b/vcl/qt5/QtInstanceIconView.cxx @@ -209,7 +209,7 @@ void QtInstanceIconView::set_item_accessible_name(int nPos, const OUString& rNam }); } -void QtInstanceIconView::remove(int) { assert(false && "Not implemented yet"); } +void QtInstanceIconView::do_remove(int) { assert(false && "Not implemented yet"); } tools::Rectangle QtInstanceIconView::get_rect(int) const { diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 33fc7e8a0efa..edb3fd9b63e9 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5603,12 +5603,10 @@ void SalInstanceIconView::set_image(int pos, VirtualDevice& rIcon) } } -void SalInstanceIconView::remove(int pos) +void SalInstanceIconView::do_remove(int pos) { - disable_notify_events(); SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos); m_xIconView->RemoveEntry(pEntry); - enable_notify_events(); } const OUString* SalInstanceIconView::getEntryData(int index) const diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index b21263c5ddc7..20f27fad6c8b 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16986,7 +16986,7 @@ private: #endif } - virtual void remove(int pos) override + virtual void do_remove(int pos) override { disable_notify_events(); GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); commit 865de6224c5319831d2f829beb3967b16511ab45 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Oct 17 22:25:19 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Oct 20 17:06:30 2025 +0200 tdf#130857 weld: Move signal blocking to IconView::clear 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: I08f9fc84584a0c1acb03e61d2eef70953eb5b059 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192614 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 4b65b3e2304e..293a7ff82e1c 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1509,6 +1509,8 @@ protected: return m_aQueryTooltipHdl.Call(rIter); } + virtual void do_clear() = 0; + public: virtual int get_item_width() const = 0; virtual void set_item_width(int width) = 0; @@ -1563,7 +1565,12 @@ public: virtual OUString get_selected_id() const = 0; - virtual void clear() = 0; + void clear() + { + disable_notify_events(); + do_clear(); + enable_notify_events(); + } virtual int count_selected_items() const = 0; diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 20c86f4a6783..49286c8ab601 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -748,7 +748,7 @@ public: virtual void insert_separator(int pos, const OUString* pId) override; - virtual void clear() override; + virtual void do_clear() override; virtual void select(int pos) override; virtual void unselect(int pos) override; diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx b/vcl/inc/qt5/QtInstanceIconView.hxx index bc266fa7b788..e3b6e704d4b9 100644 --- a/vcl/inc/qt5/QtInstanceIconView.hxx +++ b/vcl/inc/qt5/QtInstanceIconView.hxx @@ -38,7 +38,7 @@ public: virtual OUString get_selected_id() const override; - virtual void clear() override; + virtual void do_clear() override; virtual int count_selected_items() const override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 8ea31f07b02f..d5f9e7cffb5e 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1981,7 +1981,7 @@ public: virtual tools::Rectangle get_rect(int pos) const override; - virtual void clear() override; + virtual void do_clear() override; virtual ~SalInstanceIconView() override; }; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 87f3bcf87f1a..d59747cadb85 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1904,9 +1904,9 @@ void JSIconView::insert_separator(int pos, const OUString* pId) sendUpdate(); } -void JSIconView::clear() +void JSIconView::do_clear() { - SalInstanceIconView::clear(); + SalInstanceIconView::do_clear(); sendUpdate(); } diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx index 1092e1b6f160..0986e9987678 100644 --- a/vcl/qt5/QtInstanceIconView.cxx +++ b/vcl/qt5/QtInstanceIconView.cxx @@ -119,7 +119,7 @@ OUString QtInstanceIconView::get_selected_id() const return sId; } -void QtInstanceIconView::clear() +void QtInstanceIconView::do_clear() { SolarMutexGuard g; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index fd6741ad2cb1..33fc7e8a0efa 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5666,12 +5666,10 @@ tools::Rectangle SalInstanceIconView::get_rect(int pos) const return m_xIconView->GetBoundingRect(aEntry); } -void SalInstanceIconView::clear() +void SalInstanceIconView::do_clear() { - disable_notify_events(); m_xIconView->Clear(); m_aUserData.clear(); - enable_notify_events(); } SalInstanceIconView::~SalInstanceIconView() diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f01596895441..b21263c5ddc7 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -17098,7 +17098,7 @@ public: return OUString(); } - virtual void clear() override + virtual void do_clear() override { disable_notify_events(); gtk_tree_store_clear(m_pTreeStore);
