vcl/source/window/toolbox.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 63ea3783bd49e2d005f2fe9821732615166867dd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Jul 15 08:50:11 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jul 15 14:23:30 2024 +0200

    vcl: Use nNewPos consistently
    
    Use the `nNewPos` variable for assigning to
    `mnCurPos` in `ToolBox::MouseButtonDown`
    as well, rather than `i` which was the loop
    variable above, and whose value was
    assigned to `nNewPos` for the case that this
    code path is entered.
    
    Using `nNewPos` consistently makes a bit
    more obvious that this is the same as in
    the surrounding lines.
    
    Change-Id: I5ce2da04310f21070931549a599248fdcad45317
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170489
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 61245bf2fdbe..7a4195560f51 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3222,7 +3222,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
 
             // update actual data
             StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
-            mnCurPos         = i;
+            mnCurPos         = nNewPos;
             mnCurItemId      = mpData->m_aItems[nNewPos].mnId;
             mnDownItemId     = mnCurItemId;
             mnMouseModifier  = rMEvt.GetModifier();

Reply via email to