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 + #include #include @@ -432,7 +434,7 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt" uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference 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 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 + #include #include @@ -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(getParagraph(1)->getStart(), u"RubyText"_ustr)); OUString sStyle = getProperty( getParagraph(1)->getStart(), u"RubyCharStyleName"_ustr); uno::Reference 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 #endif +#include + #include #include @@ -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 + #include #include @@ -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(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 +#include #include #include @@ -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 xPara = getParagraph(1);