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 <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
praweshm
2025-12-19 13:47:42 +01:00
committed by Ilmari Lauhakangas
parent 450d64bbf9
commit 3c0d18e08a
5 changed files with 14 additions and 5 deletions
+3 -1
View File
@@ -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);
+3 -1
View File
@@ -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 );
+3 -1
View File
@@ -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--;
+3 -1
View File
@@ -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
+2 -1
View File
@@ -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);