include/vcl/weld.hxx                 |   29 ++++++++++++++++++++++++++---
 vcl/inc/jsdialog/jsdialogbuilder.hxx |    4 ++--
 vcl/inc/qt5/QtInstanceIconView.hxx   |    6 +++---
 vcl/inc/salvtables.hxx               |    6 +++---
 vcl/jsdialog/jsdialogbuilder.cxx     |    8 ++++----
 vcl/qt5/QtInstanceIconView.cxx       |    6 +++---
 vcl/source/app/salvtables.cxx        |   12 +++---------
 vcl/unx/gtk3/gtkinst.cxx             |    6 +++---
 8 files changed, 47 insertions(+), 30 deletions(-)

New commits:
commit b8d45b2e1ff2380bf67dc6ed9b9f23b649f2ae74
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Oct 17 22:47:04 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Oct 20 17:07:02 2025 +0200

    tdf#130857 weld: Move signal blocking to IconView::select
    
    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: If2c8c0289fc2aee430bab0dd1800e921e8a2ddd0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192619
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 4601abbe919d..6286b431569e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1509,6 +1509,7 @@ protected:
         return m_aQueryTooltipHdl.Call(rIter);
     }
 
+    virtual void do_select(int pos) = 0;
     virtual void do_unselect(int pos) = 0;
     virtual void do_clear() = 0;
     virtual void do_remove(int pos) = 0;
@@ -1582,7 +1583,13 @@ public:
 
     //by index. Don't select when frozen, select after thaw. Note selection 
doesn't survive a freeze.
     virtual OUString get_id(int pos) const = 0;
-    virtual void select(int pos) = 0;
+
+    void select(int pos)
+    {
+        disable_notify_events();
+        do_select(pos);
+        enable_notify_events();
+    }
 
     void unselect(int pos)
     {
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 7b9e53973429..306cf8236708 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -749,7 +749,7 @@ public:
     virtual void insert_separator(int pos, const OUString* pId) override;
 
     virtual void do_clear() override;
-    virtual void select(int pos) override;
+    virtual void do_select(int pos) override;
     virtual void do_unselect(int pos) override;
 
     // OnDemandRenderingHandler
diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx 
b/vcl/inc/qt5/QtInstanceIconView.hxx
index 183efdc42e42..a6f8f08bef71 100644
--- a/vcl/inc/qt5/QtInstanceIconView.hxx
+++ b/vcl/inc/qt5/QtInstanceIconView.hxx
@@ -45,7 +45,7 @@ public:
     virtual OUString get_selected_text() const override;
 
     virtual OUString get_id(int nPos) const override;
-    virtual void select(int nPos) override;
+    virtual void do_select(int nPos) override;
     virtual void do_unselect(int nPos) override;
     virtual void set_image(int nPos, VirtualDevice& rDevice) override;
     virtual void set_text(int nPos, const OUString& rText) override;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3e101f811750..995dc3bcd9d6 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1935,7 +1935,7 @@ public:
 
     virtual int count_selected_items() const override;
 
-    virtual void select(int pos) override;
+    virtual void do_select(int pos) override;
 
     virtual void do_unselect(int pos) override;
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index c46b572f4c1e..2508e9ee292f 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1910,9 +1910,9 @@ void JSIconView::do_clear()
     sendUpdate();
 }
 
-void JSIconView::select(int pos)
+void JSIconView::do_select(int pos)
 {
-    SalInstanceIconView::select(pos);
+    SalInstanceIconView::do_select(pos);
 
     std::unique_ptr<jsdialog::ActionDataMap> pMap = 
std::make_unique<jsdialog::ActionDataMap>();
     (*pMap)[ACTION_TYPE ""_ostr] = "select";
diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx
index beb610d2e33c..c5b1d4c9fc9c 100644
--- a/vcl/qt5/QtInstanceIconView.cxx
+++ b/vcl/qt5/QtInstanceIconView.cxx
@@ -152,7 +152,7 @@ OUString QtInstanceIconView::get_id(int nPos) const
     return sId;
 }
 
-void QtInstanceIconView::select(int nPos)
+void QtInstanceIconView::do_select(int nPos)
 {
     SolarMutexGuard g;
     GetQtInstance().RunInMainThread(
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6d2210bd3db1..e5569cbea5e1 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5452,12 +5452,11 @@ OUString SalInstanceIconView::get_selected_text() const
 
 int SalInstanceIconView::count_selected_items() const { return 
m_xIconView->GetSelectionCount(); }
 
-void SalInstanceIconView::select(int pos)
+void SalInstanceIconView::do_select(int pos)
 {
     assert(m_xIconView->IsUpdateMode()
            && "don't select when frozen, select after thaw. Note selection 
doesn't survive a "
               "freeze");
-    disable_notify_events();
     if (pos == -1 || (pos == 0 && n_children() == 0))
         m_xIconView->SelectAll(false);
     else
@@ -5466,7 +5465,6 @@ void SalInstanceIconView::select(int pos)
         m_xIconView->Select(pEntry, true);
         m_xIconView->MakeVisible(pEntry);
     }
-    enable_notify_events();
 }
 
 void SalInstanceIconView::do_unselect(int pos)
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 71527fb36da2..dac0e32cd0be 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17188,7 +17188,7 @@ public:
         return nRet;
     }
 
-    virtual void select(int pos) override
+    virtual void do_select(int pos) 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 0f180ba9bd8b5bb0ffe9a4b8e2944b1dabe8c97c
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Oct 17 22:42:35 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Oct 20 17:06:55 2025 +0200

    tdf#130857 weld: Move signal blocking to IconView::unselect
    
    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: I70533fbe1ddc854a991189e5258c536bf61e5d82
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192618
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 2da9b7235dcc..4601abbe919d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1509,6 +1509,7 @@ protected:
         return m_aQueryTooltipHdl.Call(rIter);
     }
 
+    virtual void do_unselect(int pos) = 0;
     virtual void do_clear() = 0;
     virtual void do_remove(int pos) = 0;
     virtual void do_set_cursor(const TreeIter& rIter) = 0;
@@ -1582,7 +1583,14 @@ public:
     //by index. Don't select when frozen, select after thaw. Note selection 
doesn't survive a freeze.
     virtual OUString get_id(int pos) const = 0;
     virtual void select(int pos) = 0;
-    virtual void unselect(int pos) = 0;
+
+    void unselect(int pos)
+    {
+        disable_notify_events();
+        do_unselect(pos);
+        enable_notify_events();
+    }
+
     virtual void set_image(int pos, VirtualDevice& rDevice) = 0;
     virtual void set_text(int pos, const OUString& rText) = 0;
     virtual void set_id(int pos, const OUString& rId) = 0;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 49286c8ab601..7b9e53973429 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -750,7 +750,7 @@ public:
 
     virtual void do_clear() override;
     virtual void select(int pos) override;
-    virtual void unselect(int pos) override;
+    virtual void do_unselect(int pos) override;
 
     // OnDemandRenderingHandler
     virtual void render_entry(int pos, int dpix, int dpiy) override;
diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx 
b/vcl/inc/qt5/QtInstanceIconView.hxx
index fc96267ca55c..183efdc42e42 100644
--- a/vcl/inc/qt5/QtInstanceIconView.hxx
+++ b/vcl/inc/qt5/QtInstanceIconView.hxx
@@ -46,7 +46,7 @@ public:
 
     virtual OUString get_id(int nPos) const override;
     virtual void select(int nPos) override;
-    virtual void unselect(int nPos) override;
+    virtual void do_unselect(int nPos) override;
     virtual void set_image(int nPos, VirtualDevice& rDevice) override;
     virtual void set_text(int nPos, const OUString& rText) override;
     virtual void set_id(int nPos, const OUString& rId) override;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index aa4cc2bd050d..3e101f811750 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1937,7 +1937,7 @@ public:
 
     virtual void select(int pos) override;
 
-    virtual void unselect(int pos) override;
+    virtual void do_unselect(int pos) override;
 
     virtual void select_all() override;
     virtual void unselect_all() override;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index d59747cadb85..c46b572f4c1e 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1920,9 +1920,9 @@ void JSIconView::select(int pos)
     sendAction(std::move(pMap));
 }
 
-void JSIconView::unselect(int pos)
+void JSIconView::do_unselect(int pos)
 {
-    SalInstanceIconView::unselect(pos);
+    SalInstanceIconView::do_unselect(pos);
     sendUpdate();
 }
 
diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx
index f6a4afde7f99..beb610d2e33c 100644
--- a/vcl/qt5/QtInstanceIconView.cxx
+++ b/vcl/qt5/QtInstanceIconView.cxx
@@ -159,7 +159,7 @@ void QtInstanceIconView::select(int nPos)
         [&] { m_pSelectionModel->select(m_pModel->index(nPos, 0), 
QItemSelectionModel::Select); });
 }
 
-void QtInstanceIconView::unselect(int nPos)
+void QtInstanceIconView::do_unselect(int nPos)
 {
     SolarMutexGuard g;
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 89069015fa37..6d2210bd3db1 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5469,12 +5469,11 @@ void SalInstanceIconView::select(int pos)
     enable_notify_events();
 }
 
-void SalInstanceIconView::unselect(int pos)
+void SalInstanceIconView::do_unselect(int pos)
 {
     assert(m_xIconView->IsUpdateMode()
            && "don't select when frozen, select after thaw. Note selection 
doesn't survive a "
               "freeze");
-    disable_notify_events();
     if (pos == -1)
         m_xIconView->SelectAll(true);
     else
@@ -5482,7 +5481,6 @@ void SalInstanceIconView::unselect(int pos)
         SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos);
         m_xIconView->Select(pEntry, false);
     }
-    enable_notify_events();
 }
 
 void SalInstanceIconView::select_all() { unselect(-1); }
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 0f19030d61db..71527fb36da2 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17206,7 +17206,7 @@ public:
         enable_notify_events();
     }
 
-    virtual void unselect(int pos) override
+    virtual void do_unselect(int pos) 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 7022e8b562d3888f06ef0500d89616f76015048d
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Oct 17 22:34:10 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Oct 20 17:06:49 2025 +0200

    tdf#130857 weld: Move signal blocking to IconView::set_cursor
    
    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: I69f364c0e482b9086db2e22659b5b1727fccd1ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192617
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index e13106ba8bd3..2da9b7235dcc 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_set_cursor(const TreeIter& rIter) = 0;
     virtual void do_scroll_to_item(const TreeIter& rIter) = 0;
 
 public:
@@ -1600,7 +1601,14 @@ public:
     virtual std::unique_ptr<TreeIter> make_iterator(const TreeIter* pOrig = 
nullptr) const = 0;
     virtual bool get_selected(TreeIter* pIter) const = 0;
     virtual bool get_cursor(TreeIter* pIter) const = 0;
-    virtual void set_cursor(const TreeIter& rIter) = 0;
+
+    void set_cursor(const TreeIter& rIter)
+    {
+        disable_notify_events();
+        do_set_cursor(rIter);
+        enable_notify_events();
+    }
+
     virtual bool get_iter_first(TreeIter& rIter) const = 0;
     virtual OUString get_id(const TreeIter& rIter) const = 0;
     virtual OUString get_text(const TreeIter& rIter) const = 0;
diff --git a/vcl/inc/qt5/QtInstanceIconView.hxx 
b/vcl/inc/qt5/QtInstanceIconView.hxx
index bda0cf297eda..fc96267ca55c 100644
--- a/vcl/inc/qt5/QtInstanceIconView.hxx
+++ b/vcl/inc/qt5/QtInstanceIconView.hxx
@@ -58,7 +58,7 @@ public:
                                                           = nullptr) const 
override;
     virtual bool get_selected(weld::TreeIter* pIter) const override;
     virtual bool get_cursor(weld::TreeIter* pIter) const override;
-    virtual void set_cursor(const weld::TreeIter& rIter) override;
+    virtual void do_set_cursor(const weld::TreeIter& rIter) override;
     virtual bool get_iter_first(weld::TreeIter& rIter) const override;
     virtual OUString get_id(const weld::TreeIter& rIter) const override;
     virtual OUString get_text(const weld::TreeIter& rIter) const override;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index f495e0ea23e1..aa4cc2bd050d 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1951,7 +1951,7 @@ public:
 
     virtual bool get_cursor(weld::TreeIter* pIter) const override;
 
-    virtual void set_cursor(const weld::TreeIter& rIter) override;
+    virtual void do_set_cursor(const weld::TreeIter& rIter) override;
 
     virtual bool get_iter_first(weld::TreeIter& rIter) const override;
 
diff --git a/vcl/qt5/QtInstanceIconView.cxx b/vcl/qt5/QtInstanceIconView.cxx
index 1c94f2feca1e..f6a4afde7f99 100644
--- a/vcl/qt5/QtInstanceIconView.cxx
+++ b/vcl/qt5/QtInstanceIconView.cxx
@@ -235,7 +235,7 @@ bool QtInstanceIconView::get_cursor(weld::TreeIter*) const
     return false;
 }
 
-void QtInstanceIconView::set_cursor(const weld::TreeIter& rIter)
+void QtInstanceIconView::do_set_cursor(const weld::TreeIter& rIter)
 {
     SolarMutexGuard g;
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 5efef0bd47e8..89069015fa37 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5519,12 +5519,10 @@ bool SalInstanceIconView::get_cursor(weld::TreeIter* 
pIter) const
     return pEntry != nullptr;
 }
 
-void SalInstanceIconView::set_cursor(const weld::TreeIter& rIter)
+void SalInstanceIconView::do_set_cursor(const weld::TreeIter& rIter)
 {
     const SalInstanceTreeIter& rVclIter = static_cast<const 
SalInstanceTreeIter&>(rIter);
-    disable_notify_events();
     m_xIconView->SetCurEntry(rVclIter.iter);
-    enable_notify_events();
 }
 
 bool SalInstanceIconView::get_iter_first(weld::TreeIter& rIter) const
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d846cf208de3..0f19030d61db 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17242,7 +17242,7 @@ public:
         return path != nullptr;
     }
 
-    virtual void set_cursor(const weld::TreeIter& rIter) override
+    virtual void do_set_cursor(const weld::TreeIter& rIter) override
     {
         disable_notify_events();
         const GtkInstanceTreeIter& rGtkIter = static_cast<const 
GtkInstanceTreeIter&>(rIter);

Reply via email to