hwpfilter/source/fontmap.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fb5f892ef1049b60cca11153c3367ffdafcb46a5
Author:     Simon Chenery <[email protected]>
AuthorDate: Sun Oct 5 21:29:58 2025 +0200
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Tue Nov 25 13:02:48 2025 +0100

    tdf#147021 avoid use of SAL_N_ELEMENTS macro in fontmap.cxx
    
    Also replace for loop using FontMapTab with a range-based for loop.
    
    Change-Id: I1a8f132a0a162636f805f1cd5c6bd0b95bb0a6ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191927
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Code-Style: Ilmari Lauhakangas <[email protected]>

diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx
index 7eba07c03ad3..bfdd82c84733 100644
--- a/hwpfilter/source/fontmap.cxx
+++ b/hwpfilter/source/fontmap.cxx
@@ -152,11 +152,11 @@ const char* const RepFontTab[] =
 
 int getRepFamilyName(const char* orig, char *buf, double &ratio)
 {
-    for( std::size_t i = 0 ; i < SAL_N_ELEMENTS(FontMapTab); i++)
+    for( const FontEntry& entry : FontMapTab)
     {
-        if( !strcmp(orig, FontMapTab[i].familyname) ){
-            ratio = FontMapTab[i].ratio;
-            return strlen( strcpy(buf,RepFontTab[FontMapTab[i].key]) );
+        if( !strcmp(orig, entry.familyname) ){
+            ratio = entry.ratio;
+            return strlen( strcpy(buf,RepFontTab[entry.key]) );
         }
     }
     ratio = FontMapTab[0].ratio;

Reply via email to