diff options
author | Pragat Pandya <pragat.pandya@gmail.com> | 2022-05-08 23:56:45 +0530 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2022-05-09 20:42:03 +0200 |
commit | 6abc09926c9b55a445b906303f56c6ec7fdeabf9 (patch) | |
tree | 0dda52e9d57325cc510acfa4d8951e60c84e7409 /comphelper | |
parent | 0c3950c4954848fde1515a932cc16b38ab961a7d (diff) |
tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I54257e87da0cd66da59d820c7960c3e4b020fda3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134027
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Jenkins
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/base64.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/graphicmimetype.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/misc/syntaxhighlight.cxx | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/comphelper/source/misc/base64.cxx b/comphelper/source/misc/base64.cxx index e4a818011332..5e3e3ca0afb5 100644 --- a/comphelper/source/misc/base64.cxx +++ b/comphelper/source/misc/base64.cxx @@ -122,7 +122,7 @@ void Base64::encode(OStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aP { char aCharBuffer[4]; ThreeByteToFourByte(pBuffer, i, nBufferLength, aCharBuffer); - aStrBuffer.append(aCharBuffer, SAL_N_ELEMENTS(aCharBuffer)); + aStrBuffer.append(aCharBuffer, std::size(aCharBuffer)); i += 3; } } @@ -136,7 +136,7 @@ void Base64::encode(OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& a { char aCharBuffer[4]; ThreeByteToFourByte(pBuffer, i, nBufferLength, aCharBuffer); - aStrBuffer.appendAscii(aCharBuffer, SAL_N_ELEMENTS(aCharBuffer)); + aStrBuffer.appendAscii(aCharBuffer, std::size(aCharBuffer)); i += 3; } } diff --git a/comphelper/source/misc/graphicmimetype.cxx b/comphelper/source/misc/graphicmimetype.cxx index 4448c832971f..bfa7e5c6adf6 100644 --- a/comphelper/source/misc/graphicmimetype.cxx +++ b/comphelper/source/misc/graphicmimetype.cxx @@ -53,7 +53,7 @@ OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(std::string_view rExt) OUString aMimeType; - tools::Long const nCount = SAL_N_ELEMENTS(aMapper); + tools::Long const nCount = std::size(aMapper); for (tools::Long i = 0; (i < nCount) && aMimeType.isEmpty(); ++i) { if (rExt == aMapper[i].pExt) diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index de25fd158965..3ce8086e64d5 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -713,11 +713,11 @@ SyntaxHighlighter::SyntaxHighlighter(HighlighterLanguage language): { case HighlighterLanguage::Basic: m_tokenizer->setKeyWords( strListBasicKeyWords, - SAL_N_ELEMENTS( strListBasicKeyWords )); + std::size( strListBasicKeyWords )); break; case HighlighterLanguage::SQL: m_tokenizer->setKeyWords( strListSqlKeyWords, - SAL_N_ELEMENTS( strListSqlKeyWords )); + std::size( strListSqlKeyWords )); break; default: assert(false); // this cannot happen |