vcl/source/gdi/print.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 611625a7ba08e65b579b4bdb63dfa88298b0d1dd
Author:     Kashif <[email protected]>
AuthorDate: Fri Feb 20 13:12:32 2026 +0530
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Tue Mar 3 20:11:46 2026 +0100

    tdf#147021 vcl: use std::size() instead of SAL_N_ELEMENTS()
    
    Replace the obsolete SAL_N_ELEMENTS macro with the modern C++
    std::size() function in vcl/source/gdi/print.cxx.
    
    Because the loop index variable is already of type size_t,
    this refactor avoids any signed/unsigned mismatch warnings.
    
    Change-Id: Iad521b2a9761f6270f4fa83a28f54644b16bb5b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199782
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index dca4aed24d80..2cc4a576673a 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1379,8 +1379,8 @@ OUString Printer::GetPaperName( Paper ePaper )
             PAPER_ARCHE, PAPER_SCREEN_16_9, PAPER_SCREEN_16_10, 
PAPER_16K_195x270, PAPER_16K_197x273,
             PAPER_WIDESCREEN, PAPER_ONSCREENSHOW_4_3, PAPER_ONSCREENSHOW_16_9, 
PAPER_ONSCREENSHOW_16_10
         };
-        static_assert(SAL_N_ELEMENTS(PaperIndex) == 
SAL_N_ELEMENTS(RID_STR_PAPERNAMES), "localized paper name count wrong");
-        for (size_t i = 0; i < SAL_N_ELEMENTS(PaperIndex); ++i)
+        static_assert(std::size(PaperIndex) == std::size(RID_STR_PAPERNAMES), 
"localized paper name count wrong");
+        for (size_t i = 0; i < std::size(PaperIndex); ++i)
             pSVData->maPaperNames[PaperIndex[i]] = 
VclResId(RID_STR_PAPERNAMES[i]);
     }
 

Reply via email to