summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeldin Maldonado (KNM) <kemaldonado@csumb.edu>2024-02-25 21:13:35 -0800
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2024-02-29 08:19:54 +0100
commitc78679b349573d718f8641071928d5f2edb47efa (patch)
treeeeeb0e46d6231b21f3ad715b8d0410f4f2202e26
parentc39b832e85ae9e172f51c77c40d74949afcc0ac3 (diff)
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.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
-rw-r--r--sc/source/filter/excel/xistyle.cxx2
-rw-r--r--sc/source/filter/excel/xlpage.cxx2
-rw-r--r--sc/source/filter/excel/xltools.cxx10
3 files changed, 7 insertions, 7 deletions
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 )
{