include/vcl/weld.hxx                     |   11 +++++++----
 svtools/source/control/scrolladaptor.cxx |    2 +-
 vcl/source/app/salvtables.cxx            |    5 ++++-
 vcl/unx/gtk3/gtkinst.cxx                 |    2 +-
 4 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit c4dbac16a1a241c60f8f72be57191efe65ebebef
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sun Mar 2 00:49:24 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Mar 2 11:52:32 2025 +0100

    weld::Scrollbar: Make clear that signal is about value change
    
    A GtkAdjustment [1] doesn't only have a current value, but
    also lower + upper bounds,...
    
    Rename weld::Scrollbar::signal_adjustment_changed
    to weld::Scrollbar::signal_adjustment_value_changed
    etc. to make clearer that this signal is only emitted
    when the current value changes, not any of the other
    things an adjustment manages (and that can be set
    via the weld::Scrollbar API, for example).
    
    See how the GtkInstanceScrollbar ctor connects
    the `signalAdjustValueChanged` callback to the
    GtkAdjustment:value-changed signal [2], not the
    GtkAdjustment:changed signal [3], which means that
    only changes to the current value trigger the callback
    (which in turn calls `signal_adjustment_value_changed()`),
    but changes to other GtkAdjustment properties don't.
    
    [1] https://docs.gtk.org/gtk3/class.Adjustment.html
    [2] https://docs.gtk.org/gtk3/signal.Adjustment.value-changed.html
    [3] https://docs.gtk.org/gtk3/signal.Adjustment.changed.html
    
    Change-Id: Icbeb92f3e53e0747154038aeca2f11626623fbae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182400
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 726406afb8e3..a7a5c4ad2d6d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2693,10 +2693,10 @@ public:
 
 class VCL_DLLPUBLIC Scrollbar : virtual public Widget
 {
-    Link<Scrollbar&, void> m_aChangeHdl;
+    Link<Scrollbar&, void> m_aValueChangeHdl;
 
 protected:
-    void signal_adjustment_changed() { m_aChangeHdl.Call(*this); }
+    void signal_adjustment_value_changed() { m_aValueChangeHdl.Call(*this); }
 
 public:
     virtual void adjustment_configure(int value, int lower, int upper, int 
step_increment,
@@ -2721,7 +2721,10 @@ public:
 
     virtual ScrollType get_scroll_type() const = 0;
 
-    void connect_adjustment_changed(const Link<Scrollbar&, void>& rLink) { 
m_aChangeHdl = rLink; }
+    void connect_adjustment_value_changed(const Link<Scrollbar&, void>& rLink)
+    {
+        m_aValueChangeHdl = rLink;
+    }
 };
 
 class VCL_DLLPUBLIC SizeGroup
diff --git a/svtools/source/control/scrolladaptor.cxx 
b/svtools/source/control/scrolladaptor.cxx
index 290468254149..38424001b306 100644
--- a/svtools/source/control/scrolladaptor.cxx
+++ b/svtools/source/control/scrolladaptor.cxx
@@ -105,7 +105,7 @@ void ScrollAdaptor::EnableRTL(bool bEnable) { 
m_xScrollBar->set_direction(bEnabl
 void ScrollAdaptor::SetScrollHdl(const Link<weld::Scrollbar&, void>& rLink)
 {
     m_aLink = rLink;
-    m_xScrollBar->connect_adjustment_changed(rLink);
+    m_xScrollBar->connect_adjustment_value_changed(rLink);
 }
 
 void ScrollAdaptor::SetMouseReleaseHdl(const Link<const MouseEvent&, bool>& 
rLink)
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3c66d4a2284e..c9c4d2891eda 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2634,7 +2634,10 @@ public:
 };
 }
 
-IMPL_LINK_NOARG(SalInstanceScrollbar, ScrollHdl, ScrollBar*, void) { 
signal_adjustment_changed(); }
+IMPL_LINK_NOARG(SalInstanceScrollbar, ScrollHdl, ScrollBar*, void)
+{
+    signal_adjustment_value_changed();
+}
 
 SalInstanceNotebook::SalInstanceNotebook(TabControl* pNotebook, 
SalInstanceBuilder* pBuilder,
                                          bool bTakeOwnership)
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 74a7df140d44..eae4e3a5fc4c 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -8634,7 +8634,7 @@ private:
     {
         GtkInstanceScrollbar* pThis = 
static_cast<GtkInstanceScrollbar*>(widget);
         SolarMutexGuard aGuard;
-        pThis->signal_adjustment_changed();
+        pThis->signal_adjustment_value_changed();
     }
 
 #if GTK_CHECK_VERSION(4, 0, 0)
commit 8c86f055e3e9a1500858e95a1a5b3dd9cfaad3f3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sun Mar 2 00:36:03 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sun Mar 2 11:52:24 2025 +0100

    weld: Don't use "upper" as param name for lower
    
    The GtkInstanceScrollbar and SalInstanceScrollbar
    overrides already use "lower" for the param name
    as well.
    
    Change-Id: If92382e4b67bf919f85e4804012563c5d87cc887
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182399
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 85ac1f11964d..726406afb8e3 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2713,7 +2713,7 @@ public:
     virtual int adjustment_get_step_increment() const = 0;
     virtual void adjustment_set_step_increment(int size) = 0;
     virtual int adjustment_get_lower() const = 0;
-    virtual void adjustment_set_lower(int upper) = 0;
+    virtual void adjustment_set_lower(int lower) = 0;
 
     virtual int get_scroll_thickness() const = 0;
     virtual void set_scroll_thickness(int nThickness) = 0;

Reply via email to