chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c2cdae9c87cead2a7901b0c173a9561e24162678
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Nov 14 19:46:47 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Nov 15 16:17:55 2021 +0100

    Resolves: tdf#145663 nL is the index of the light to set to the model
    
    don't reuse the variable in another loop before its finally set to the
    model
    
    Change-Id: I336d8c0f3ce612448dd639e939e65fb434da1513
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125208
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx 
b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 878f3fa0b204..74c2de00b5b9 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -433,20 +433,20 @@ IMPL_LINK(ThreeD_SceneIllumination_TabPage, 
ClickLightSourceButtonHdl, weld::But
     bool bIsChecked = pInfo->pButton->get_prev_active();
 
     ControllerLockGuardUNO aGuard( m_xChartModel );
-    for( nL=0; nL<8; nL++)
+    for (sal_Int32 i = 0; i < 8; ++i)
     {
-        LightButton* pLightButton = m_pLightSourceInfoList[nL].pButton;
+        LightButton* pLightButton = m_pLightSourceInfoList[i].pButton;
         if (pLightButton == pButton)
         {
             pLightButton->set_active(true);
             if (!pLightButton->get_widget()->has_focus())
                 pLightButton->get_widget()->grab_focus();
-            m_pLightSourceInfoList[nL].pButton->set_prev_active(true);
+            m_pLightSourceInfoList[i].pButton->set_prev_active(true);
         }
         else
         {
             pLightButton->set_active(false);
-            m_pLightSourceInfoList[nL].pButton->set_prev_active(false);
+            m_pLightSourceInfoList[i].pButton->set_prev_active(false);
         }
     }
 

Reply via email to