tdf#147021 replace SAL_N_ELEMENTS() with std::size()

Change-Id: I8d704123aaa968352033d1b6680d5da6153eba21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165268
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Mohit Marathe 2024-03-25 13:08:57 +05:30 committed by Michael Weghorn
parent c4be391530
commit 913437f3cd

View file

@ -188,7 +188,7 @@ void Test::testParse() {
"/", false, 1, "", "", "", "", "", nullptr, nullptr },
{ "////", nullptr, "////", true, "",
"//", false, 2, "", "", "", "", "", nullptr, nullptr } };
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > uriRef(
m_uriFactory->parse(
OUString::createFromAscii(data[i].uriReference)));
@ -986,7 +986,7 @@ void Test::testMakeAbsolute() {
"scheme:/a/../b/c" },
{ "scheme:/a/../b/c", "d", true, css::uri::RelativeUriExcessParentSegments_REMOVE,
"scheme:/b/d" } };
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > baseUriRef(
m_uriFactory->parse(
OUString::createFromAscii(data[i].baseUriReference)));
@ -1116,7 +1116,7 @@ void Test::testMakeRelative() {
{ "scheme:/a/b/c", "scheme:/d/e/f", true, true, false, "/d/e/f", nullptr },
{ "scheme:a/b/c", "scheme:d/e/f", true, true, false, "scheme:d/e/f", nullptr },
{ "scheme:/a/b/c", "scheme:d/e/f", true, true, false, "scheme:d/e/f", nullptr } };
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > baseUriRef(
m_uriFactory->parse(
OUString::createFromAscii(data[i].baseUriReference)));
@ -1167,7 +1167,7 @@ void Test::testVndSunStarExpand() {
m_context->getValueByName(
"/singletons/com.sun.star.util.theMacroExpander"),
css::uno::UNO_QUERY_THROW);
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > uriRef(
m_uriFactory->parse(
OUString::createFromAscii(data[i].uriReference)));
@ -1207,7 +1207,7 @@ void Test::testVndSunStarScript() {
{ "vnd.sun.star.script:name?a=&", nullptr, true, {} },
{ "vnd.sun.star.script:name?key1=&%26=%3D&key1=hello", "name", true,
{ { "key1", "" }, { "key2", nullptr }, { "&", "=" } } } };
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > uriRef(
m_uriFactory->parse(
OUString::createFromAscii(data[i].uriReference)));
@ -1363,7 +1363,7 @@ void Test::testTranslator() {
{ "file:///abc/%25ef", "file:///abc/%25ef", true } };
css::uno::Reference< css::uri::XExternalUriReferenceTranslator >
translator(css::uri::ExternalUriReferenceTranslator::create(m_context));
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
if (data[i].toInternal) {
TEST_ASSERT_EQUAL(
"testTranslator, translateToInternal", i,
@ -1394,7 +1394,7 @@ void Test::testPkgUrlFactory() {
"vnd.sun.star.pkg://file:%2F%2F%2Fa%2525b%252fc%2Fd~e&f@g%3Fh" } };
css::uno::Reference< css::uri::XVndSunStarPkgUrlReferenceFactory > factory(
css::uri::VndSunStarPkgUrlReferenceFactory::create(m_context));
for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
for (std::size_t i = 0; i < std::size(data); ++i) {
css::uno::Reference< css::uri::XUriReference > url(
factory->createVndSunStarPkgUrlReference(
m_uriFactory->parse(