sw/qa/extras/odfexport/odfexport2.cxx | 4 +++- sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 4 +++- sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 4 +++- sw/qa/extras/rtfexport/rtfexport.cxx | 4 +++- sw/qa/extras/ww8export/ww8export.cxx | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-)
New commits: commit 3c0d18e08a3c800356fb13de7aefe2c077017d8f Author: praweshm <[email protected]> AuthorDate: Tue Dec 16 14:55:06 2025 +0530 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Fri Dec 19 13:47:42 2025 +0100 tdf#147021 use std::size() instead of SAL_N_ELEMENTS Change-Id: Ic76de1703d3abaf108cc8467e1cd78ca5a8ce4af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195698 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 7bd37ed31582..d98f21885eef 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <iterator> + #include <swmodeltestbase.hxx> #include <com/sun/star/drawing/BarCode.hpp> @@ -432,7 +434,7 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt" uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); - for (size_t i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++) + for (size_t i = 0; i < std::size(aFieldTexts); i++) { uno::Any aField = xFields->nextElement(); uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 4f23f1127db9..db00587b9ac4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <iterator> + #include <swmodeltestbase.hxx> #include <com/sun/star/style/BreakType.hpp> @@ -512,7 +514,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf49073, "tdf49073.docx") { // test case for Asian phontic guide (ruby text.) sal_Unicode aRuby[3] = {0x304D,0x3082,0x3093}; - OUString sRuby(aRuby, SAL_N_ELEMENTS(aRuby)); + OUString sRuby(aRuby, std::size(aRuby)); CPPUNIT_ASSERT_EQUAL(sRuby,getProperty<OUString>(getParagraph(1)->getStart(), u"RubyText"_ustr)); OUString sStyle = getProperty<OUString>( getParagraph(1)->getStart(), u"RubyCharStyleName"_ustr); uno::Reference<beans::XPropertySet> xPropertySet(getStyles(u"CharacterStyles"_ustr)->getByName(sStyle), uno::UNO_QUERY ); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index a71cdbea494e..e6e1a6dc9190 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -14,6 +14,8 @@ #include <postmac.h> #endif +#include <iterator> + #include <swmodeltestbase.hxx> #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp> @@ -962,7 +964,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129912) static constexpr OUString pLabel5 = u"\uF0D1\uF031\uF032b"_ustr; const OUString sFootnoteLabels[] = { OUString(u'\xF0A7'), u"1"_ustr, u"2"_ustr, OUString(u'\xF020'), pLabel5 }; - CPPUNIT_ASSERT_EQUAL(sal_Int32(SAL_N_ELEMENTS(sFootnoteLabels)), nCount); + CPPUNIT_ASSERT_EQUAL(sal_Int32(std::size(sFootnoteLabels)), nCount); pWrtShell->GotoPrevFootnoteAnchor(); nCount--; diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 280afd2170e0..1b526b1ffedf 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <iterator> + #include <swmodeltestbase.hxx> #include <com/sun/star/awt/Gradient2.hpp> @@ -440,7 +442,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf49073) auto verify = [this]() { // test case for Asian phontic guide (ruby text.) sal_Unicode aRuby[3] = { 0x304D, 0x3082, 0x3093 }; - OUString sRuby(aRuby, SAL_N_ELEMENTS(aRuby)); + OUString sRuby(aRuby, std::size(aRuby)); CPPUNIT_ASSERT_EQUAL(sRuby, getProperty<OUString>(getParagraph(1)->getStart(), u"RubyText"_ustr)); OUString sStyle diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 691f64f8eeac..d6f664a1c7e7 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -9,6 +9,7 @@ #include <sal/config.h> +#include <iterator> #include <string_view> #include <swmodeltestbase.hxx> @@ -1384,7 +1385,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCommentExport) OUString sNames[6]; - const int nNumberOfTextPortions = SAL_N_ELEMENTS(aTextPortions); + const int nNumberOfTextPortions = std::size(aTextPortions); uno::Reference<text::XTextRange> xPara = getParagraph(1);
