fpicker/source/win32/resourceprovider.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 76a23a3293fa65acf408a065b3861bc573d18ca7
Author:     Simon Chenery <[email protected]>
AuthorDate: Sat Aug 23 16:15:13 2025 +0200
Commit:     David Gilbert <[email protected]>
CommitDate: Sat Sep 6 02:23:09 2025 +0200

    tdf#147021 avoid use of SAL_N_ELEMENTS macro in resourceprovider.cxx
    
    Also replace for loop that used SIZE_TABLE with a range-based for loop.
    
    Change-Id: Ibefab2e1de35ed1f0cdc0b09a976acc35f8184ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190101
    Reviewed-by: David Gilbert <[email protected]>
    Tested-by: Jenkins

diff --git a/fpicker/source/win32/resourceprovider.cxx 
b/fpicker/source/win32/resourceprovider.cxx
index d3ac79002340..3e0609ed7780 100644
--- a/fpicker/source/win32/resourceprovider.cxx
+++ b/fpicker/source/win32/resourceprovider.cxx
@@ -70,17 +70,15 @@ Entry const CtrlIdToResIdTable[] = {
     { CHECKBOX_GPGSIGN,                         STR_SVT_FILEPICKER_GPGSIGN }
 };
 
-const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable );
-
 static TranslateId CtrlIdToResId( sal_Int32 aControlId )
 {
     TranslateId pResId;
 
-    for ( sal_Int32 i = 0; i < SIZE_TABLE; i++ )
+    for ( const auto& entry : CtrlIdToResIdTable )
     {
-        if ( CtrlIdToResIdTable[i].ctrlId == aControlId )
+        if ( entry.ctrlId == aControlId )
         {
-            pResId = CtrlIdToResIdTable[i].resId;
+            pResId = entry.resId;
             break;
         }
     }

Reply via email to