summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorGautham Krishnan <gauthamkrishnanpriya@gmail.com>2022-03-01 12:04:38 +0530
committerHossein <hossein@libreoffice.org>2022-03-10 00:40:02 +0100
commit51fb84829afbc1c0957fd1a489085613ad199f1a (patch)
tree2411be12fb6ad0b526f5ef977a31fecd559c81d4 /sax
parent409371801a6c4ee00d7e55984e746ea9fe942447 (diff)
tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: If35c679839b39a01e474f7b0b0abee570e85bdd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130798 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'sax')
-rw-r--r--sax/qa/cppunit/xmlimport.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx
index fcf839609cac..1eb872d50585 100644
--- a/sax/qa/cppunit/xmlimport.cxx
+++ b/sax/qa/cppunit/xmlimport.cxx
@@ -288,13 +288,13 @@ Sequence< sal_Int8 > DummyTokenHandler::getUTF8Identifier( sal_Int32 nToken )
if ( ( nToken & 0xffff0000 ) != 0 ) //namespace
{
sal_uInt32 nNamespaceToken = ( nToken >> 16 ) - 1;
- if ( nNamespaceToken < SAL_N_ELEMENTS(namespacePrefixes) )
+ if ( nNamespaceToken < std::size(namespacePrefixes) )
aUtf8Token = namespacePrefixes[ nNamespaceToken ];
}
else //element or attribute
{
size_t nElementToken = nToken & 0xffff;
- if ( nElementToken < SAL_N_ELEMENTS(tokens) )
+ if ( nElementToken < std::size(tokens) )
aUtf8Token = tokens[ nElementToken ];
}
Sequence< sal_Int8 > aSeq( reinterpret_cast< const sal_Int8* >(
@@ -311,7 +311,7 @@ sal_Int32 DummyTokenHandler::getTokenFromUTF8( const uno::Sequence< sal_Int8 >&
sal_Int32 DummyTokenHandler::getTokenDirect( const char* pToken, sal_Int32 nLength ) const
{
std::string_view sToken( pToken, nLength );
- for( size_t i = 0; i < SAL_N_ELEMENTS(tokens); i++ )
+ for( size_t i = 0; i < std::size(tokens); i++ )
{
if ( tokens[i] == sToken )
return static_cast<sal_Int32>(i);
@@ -380,7 +380,7 @@ void XMLImportTest::parse()
"multiplens.xml", "multiplepfx.xml",
"nstoattributes.xml", "nestedns.xml", "testthreading.xml"};
- for (size_t i = 0; i < SAL_N_ELEMENTS( fileNames ); i++)
+ for (size_t i = 0; i < std::size( fileNames ); i++)
{
InputSource source;
source.sSystemId = "internal";
@@ -407,7 +407,7 @@ void XMLImportTest::testMissingNamespaceDeclaration()
uno::UNO_QUERY_THROW);
xInit->initialize({ uno::Any(OUString("IgnoreMissingNSDecl")) });
- for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS( fileNames ); i++)
+ for (sal_uInt16 i = 0; i < std::size( fileNames ); i++)
{
try
{