sc/source/filter/excel/xistyle.cxx |    2 +-
 sc/source/filter/excel/xlpage.cxx  |    2 +-
 sc/source/filter/excel/xltools.cxx |   10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit c78679b349573d718f8641071928d5f2edb47efa
Author:     Keldin Maldonado (KNM) <kemaldon...@csumb.edu>
AuthorDate: Sun Feb 25 21:13:35 2024 -0800
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Thu Feb 29 08:19:54 2024 +0100

    tdf#147021 replace SAL_N_ELEMENTS() with std::size()
    
    Change-Id: I2a415e7c20d134d400e48745278597b475076d52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163927
    Tested-by: Jenkins
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 15ce0ce667c4..223eed9924f8 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -967,7 +967,7 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, 
const XclImpPalette&
 
     if( nXclLine == EXC_LINE_NONE )
         return false;
-    if( nXclLine >= SAL_N_ELEMENTS( ppnLineParam ) )
+    if( nXclLine >= std::size( ppnLineParam ) )
         nXclLine = EXC_LINE_THIN;
 
     rLine.SetColor( rPalette.GetColor( nXclColor ) );
diff --git a/sc/source/filter/excel/xlpage.cxx 
b/sc/source/filter/excel/xlpage.cxx
index 937aa9427f31..dfcdbccde45d 100644
--- a/sc/source/filter/excel/xlpage.cxx
+++ b/sc/source/filter/excel/xlpage.cxx
@@ -193,7 +193,7 @@ void XclPageData::SetDefaults()
 Size XclPageData::GetScPaperSize() const
 {
     const XclPaperSize* pEntry = pPaperSizeTable;
-    if( mnPaperSize < SAL_N_ELEMENTS( pPaperSizeTable ) )
+    if( mnPaperSize < std::size( pPaperSizeTable ) )
         pEntry += mnPaperSize;
 
     Size aSize;
diff --git a/sc/source/filter/excel/xltools.cxx 
b/sc/source/filter/excel/xltools.cxx
index 35ef279161cb..c6ecb31ed6d5 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -352,7 +352,7 @@ Color XclTools::GetPatternColor( const Color& rPattColor, 
const Color& rBackColo
         0x40, 0x40, 0x20, 0x60, 0x60, 0x60, 0x60, 0x48,     // 08 - 15
         0x50, 0x70, 0x78                                    // 16 - 18
     };
-    return (nXclPattern < SAL_N_ELEMENTS( pnRatioTable )) ?
+    return (nXclPattern < std::size( pnRatioTable )) ?
         ScfTools::GetMixedColor( rPattColor, rBackColor, pnRatioTable[ 
nXclPattern ] ) : rPattColor;
 }
 
@@ -478,10 +478,10 @@ const char* const ppcDefNames[] =
 
 OUString XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn )
 {
-    OSL_ENSURE( SAL_N_ELEMENTS( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
+    OSL_ENSURE( std::size( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
         "XclTools::GetXclBuiltInDefName - built-in defined name list modified" 
);
 
-    if( cBuiltIn < SAL_N_ELEMENTS( ppcDefNames ) )
+    if( cBuiltIn < std::size( ppcDefNames ) )
         return OUString::createFromAscii(ppcDefNames[cBuiltIn]);
     else
         return OUString::number(cBuiltIn);
@@ -553,7 +553,7 @@ OUString XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, 
std::u16string_view
     else
     {
         OUStringBuffer aBuf(maStyleNamePrefix1);
-        if( nStyleId < SAL_N_ELEMENTS( ppcStyleNames ) )
+        if( nStyleId < std::size( ppcStyleNames ) )
             aBuf.appendAscii(ppcStyleNames[nStyleId]);
         else if (!rName.empty())
             aBuf.append(rName);
@@ -590,7 +590,7 @@ bool XclTools::IsBuiltInStyleName( const OUString& 
rStyleName, sal_uInt8* pnStyl
         nPrefixLen = strlen(maStyleNamePrefix2);
     if( nPrefixLen > 0 )
     {
-        for( sal_uInt8 nId = 0; nId < SAL_N_ELEMENTS( ppcStyleNames ); ++nId )
+        for( sal_uInt8 nId = 0; nId < std::size( ppcStyleNames ); ++nId )
         {
             if( nId != EXC_STYLE_NORMAL )
             {

Reply via email to