reportdesign/source/ui/dlg/Navigator.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit b59ff1254461f72c929802949dec6f92ac2938fe
Author:     Simon Chenery <[email protected]>
AuthorDate: Sun Nov 23 18:57:04 2025 +0100
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Mon Nov 24 13:05:32 2025 +0100

    tdf#147021 avoid use of SAL_N_ELEMENTS macro in Navigator.cxx
    
    Change-Id: Iaa3ac9edf617231fd8cc2dd821b7764e4c35c3f4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194399
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/reportdesign/source/ui/dlg/Navigator.cxx 
b/reportdesign/source/ui/dlg/Navigator.cxx
index 31bce2c878dc..65d89359c372 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -276,20 +276,20 @@ IMPL_LINK(NavigatorTree, CommandHdl, const CommandEvent&, 
rEvt, bool)
             std::unique_ptr<weld::Menu> 
xContextMenu(xBuilder->weld_menu(u"menu"_ustr));
 
             const OUString aIds[] = { u"sorting"_ustr, u"page"_ustr, 
u"report"_ustr, u"function"_ustr, u"properties"_ustr, u"delete"_ustr };
-            for (size_t i = 0; i < SAL_N_ELEMENTS(aIds); ++i)
+            for (const auto& sIdentifier : aIds)
             {
-                sal_uInt16 nSId = mapIdent(aIds[i]);
+                sal_uInt16 nSId = mapIdent(sIdentifier);
 
-                if (aIds[i] == "page" || aIds[i] == "report" || aIds[i] == 
"properties")
-                    xContextMenu->set_active(aIds[i], 
m_rController.isCommandChecked(nSId));
+                if (sIdentifier == "page" || sIdentifier == "report" || 
sIdentifier == "properties")
+                    xContextMenu->set_active(sIdentifier, 
m_rController.isCommandChecked(nSId));
                 bool bEnabled = m_rController.isCommandEnabled(nSId);
                 if (nSId == SID_RPT_NEW_FUNCTION)
-                    xContextMenu->set_sensitive(aIds[i], 
m_rController.isEditable() && (xSupplier.is() || xFunctions.is()));
+                    xContextMenu->set_sensitive(sIdentifier, 
m_rController.isEditable() && (xSupplier.is() || xFunctions.is()));
                 // special condition, check for function and group
                 else if (nSId == SID_DELETE)
-                    xContextMenu->set_sensitive(aIds[i], bDeleteAllowed);
+                    xContextMenu->set_sensitive(sIdentifier, bDeleteAllowed);
                 else
-                    xContextMenu->set_sensitive(aIds[i], bEnabled);
+                    xContextMenu->set_sensitive(sIdentifier, bEnabled);
             }
 
             // the point that was clicked on

Reply via email to