tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I54257e87da0cd66da59d820c7960c3e4b020fda3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134027
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Jenkins
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 4a84812..d7ab2ee 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -137,7 +137,7 @@ void PropBrw::ImplReCreateController()
::cppu::ContextEntry_Init( "ContextDocument", Any( m_xContextDocument ) )
};
Reference< XComponentContext > xInspectorContext(
::cppu::createComponentContext( aHandlerContextInfo, SAL_N_ELEMENTS( aHandlerContextInfo ), xOwnContext ) );
::cppu::createComponentContext( aHandlerContextInfo, std::size( aHandlerContextInfo ), xOwnContext ) );
// create a property browser controller
Reference< XMultiComponentFactory > xFactory( xInspectorContext->getServiceManager(), UNO_SET_THROW );
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 9be47bf..a060b3f 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -377,7 +377,7 @@ SbiToken SbiTokenizer::Next()
}
// valid token?
short lb = 0;
short ub = SAL_N_ELEMENTS(aTokTable_Basic)-1;
short ub = std::size(aTokTable_Basic)-1;
short delta;
do
{
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 82080df..ec2783b 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -600,7 +600,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
sal_Unicode aBuf[2];
aBuf[0] = '0';
aBuf[1] = '0' + nMin;
rRes = OUString(aBuf, SAL_N_ELEMENTS(aBuf));
rRes = OUString(aBuf, std::size(aBuf));
}
else
{
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index 050ebec..d06e7d2 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -991,7 +991,7 @@ void Bridge::makeReleaseCall(
// its own:
static auto const tid = [] {
static sal_Int8 const id[] = {'r', 'e', 'l', 'e', 'a', 's', 'e', 'h', 'a', 'c', 'k'};
return rtl::ByteSequence(id, SAL_N_ELEMENTS(id));
return rtl::ByteSequence(id, std::size(id));
}();
sendRequest(
tid, oid, type,
diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx
index 031068a..431f9ce 100644
--- a/canvas/workben/canvasdemo.cxx
+++ b/canvas/workben/canvasdemo.cxx
@@ -208,7 +208,7 @@ class DemoRenderer
{
const double SCALE=7.0;
const char hilbert[] = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd";
int nLength = SAL_N_ELEMENTS( hilbert );
int nLength = std::size( hilbert );
uno::Sequence< geometry::RealPoint2D > aPoints( nLength );
auto pPoints = aPoints.getArray();
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index acb42fc..f6bbfe2 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -151,7 +151,7 @@ void ConfigColorScheme::retrieveConfigColors()
0xff00ff, 0x00ffff, 0xffff00
};
static const sal_Int32 nMaxDefaultColors = SAL_N_ELEMENTS( nDefaultColors );
static const sal_Int32 nMaxDefaultColors = std::size( nDefaultColors );
return nDefaultColors[ nIndex % nMaxDefaultColors ];
}
diff --git a/comphelper/source/misc/base64.cxx b/comphelper/source/misc/base64.cxx
index e4a8180..5e3e3ca 100644
--- a/comphelper/source/misc/base64.cxx
+++ b/comphelper/source/misc/base64.cxx
@@ -122,7 +122,7 @@ void Base64::encode(OStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aP
{
char aCharBuffer[4];
ThreeByteToFourByte(pBuffer, i, nBufferLength, aCharBuffer);
aStrBuffer.append(aCharBuffer, SAL_N_ELEMENTS(aCharBuffer));
aStrBuffer.append(aCharBuffer, std::size(aCharBuffer));
i += 3;
}
}
@@ -136,7 +136,7 @@ void Base64::encode(OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& a
{
char aCharBuffer[4];
ThreeByteToFourByte(pBuffer, i, nBufferLength, aCharBuffer);
aStrBuffer.appendAscii(aCharBuffer, SAL_N_ELEMENTS(aCharBuffer));
aStrBuffer.appendAscii(aCharBuffer, std::size(aCharBuffer));
i += 3;
}
}
diff --git a/comphelper/source/misc/graphicmimetype.cxx b/comphelper/source/misc/graphicmimetype.cxx
index 4448c832..bfa7e5c 100644
--- a/comphelper/source/misc/graphicmimetype.cxx
+++ b/comphelper/source/misc/graphicmimetype.cxx
@@ -53,7 +53,7 @@ OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(std::string_view rExt)
OUString aMimeType;
tools::Long const nCount = SAL_N_ELEMENTS(aMapper);
tools::Long const nCount = std::size(aMapper);
for (tools::Long i = 0; (i < nCount) && aMimeType.isEmpty(); ++i)
{
if (rExt == aMapper[i].pExt)
diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx
index de25fd1..3ce8086 100644
--- a/comphelper/source/misc/syntaxhighlight.cxx
+++ b/comphelper/source/misc/syntaxhighlight.cxx
@@ -713,11 +713,11 @@ SyntaxHighlighter::SyntaxHighlighter(HighlighterLanguage language):
{
case HighlighterLanguage::Basic:
m_tokenizer->setKeyWords( strListBasicKeyWords,
SAL_N_ELEMENTS( strListBasicKeyWords ));
std::size( strListBasicKeyWords ));
break;
case HighlighterLanguage::SQL:
m_tokenizer->setKeyWords( strListSqlKeyWords,
SAL_N_ELEMENTS( strListSqlKeyWords ));
std::size( strListSqlKeyWords ));
break;
default:
assert(false); // this cannot happen
diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
index 173f879..0e81e71 100644
--- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
+++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
@@ -139,7 +139,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( )
::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
const sal_Int32* pType = pTypes;
for (sal_Int32 i = 1; i <= sal_Int32(SAL_N_ELEMENTS(pTypes)); ++i,++pType)
for (sal_Int32 i = 1; i <= sal_Int32(std::size(pTypes)); ++i,++pType)
{
ORowSetValue aValue;
aValue.fill(i,*pType,xRow);
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index c4abecf1..c25c0d6 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -1463,7 +1463,7 @@ ADORecordset* WpADOConnection::getExportedKeys( const css::uno::Any& catalog, co
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1503,7 +1503,7 @@ ADORecordset* WpADOConnection::getImportedKeys( const css::uno::Any& catalog, co
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1545,7 +1545,7 @@ ADORecordset* WpADOConnection::getPrimaryKeys( const css::uno::Any& catalog, con
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1585,7 +1585,7 @@ ADORecordset* WpADOConnection::getIndexInfo(
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1627,7 +1627,7 @@ ADORecordset* WpADOConnection::getTablePrivileges( const css::uno::Any& catalog,
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1673,7 +1673,7 @@ ADORecordset* WpADOConnection::getCrossReference( const css::uno::Any& primaryCa
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1722,7 +1722,7 @@ ADORecordset* WpADOConnection::getProcedures( const css::uno::Any& catalog,
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1763,7 +1763,7 @@ ADORecordset* WpADOConnection::getProcedureColumns( const css::uno::Any& catalog
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1834,7 +1834,7 @@ ADORecordset* WpADOConnection::getTables( const css::uno::Any& catalog,
varCriteria[nPos].setString(sTypeNames);
// Create SafeArray Bounds and initialize the array
const sal_Int32 nCrit = SAL_N_ELEMENTS(varCriteria);
const sal_Int32 nCrit = std::size(varCriteria);
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = nCrit;
@@ -1871,7 +1871,7 @@ ADORecordset* WpADOConnection::getColumns( const css::uno::Any& catalog,
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1915,7 +1915,7 @@ ADORecordset* WpADOConnection::getColumnPrivileges( const css::uno::Any& catalog
// Create SafeArray Bounds and initialize the array
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = SAL_N_ELEMENTS(varCriteria);
rgsabound[0].cElements = std::size(varCriteria);
psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound );
sal_Int32 nPos=0;
@@ -1950,7 +1950,7 @@ ADORecordset* WpADOConnection::getTypeInfo(DataTypeEnum /*_eType*/)
{
// Create elements used in the array
OLEVariant varCriteria[2];
const int nCrit = SAL_N_ELEMENTS(varCriteria);
const int nCrit = std::size(varCriteria);
// Create SafeArray Bounds and initialize the array
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 1dc72f6..dbb8cb4 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -996,7 +996,7 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTableTypes( )
rtl::Reference<::connectivity::ODatabaseMetaDataResultSet> pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
// here we fill the rows which should be visible when ask for data from the resultset returned here
auto nNbTypes = SAL_N_ELEMENTS(sTableTypes);
auto nNbTypes = std::size(sTableTypes);
ODatabaseMetaDataResultSet::ORows aRows;
for(std::size_t i=0;i < nNbTypes;++i)
{
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index bd2f8470a..2633fd0 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -449,7 +449,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
for (sal_Int32 i = 1 ; i <= nCount ; ++i)
{
sColumnName = xMeta->getColumnName(i);
for (size_t j = 0 ; j < SAL_N_ELEMENTS(sPrivs); ++j)
for (size_t j = 0 ; j < std::size(sPrivs); ++j)
{
if ( sPrivs[j] == sColumnName )
{
diff --git a/connectivity/source/drivers/postgresql/pq_statics.cxx b/connectivity/source/drivers/postgresql/pq_statics.cxx
index 3ae01b8..ec3d0d8 100644
--- a/connectivity/source/drivers/postgresql/pq_statics.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statics.cxx
@@ -196,7 +196,7 @@ Statics & getStatics()
PropertyDef( statics.TYPE , tString )
};
ist.pProps = createPropertyArrayHelper(
tableDef, SAL_N_ELEMENTS(tableDef), READONLY );
tableDef, std::size(tableDef), READONLY );
statics.refl.tableDescriptor.implName =
"org.openoffice.comp.pq.sdbcx.TableDescriptor";
@@ -210,7 +210,7 @@ Statics & getStatics()
PropertyDef( statics.SCHEMA_NAME , tString )
};
statics.refl.tableDescriptor.pProps = createPropertyArrayHelper(
tableDescDef, SAL_N_ELEMENTS(tableDescDef), 0 );
tableDescDef, std::size(tableDescDef), 0 );
// Column props set
statics.refl.column.implName = "org.openoffice.comp.pq.sdbcx.Column";
@@ -232,7 +232,7 @@ Statics & getStatics()
PropertyDefEx( statics.TYPE_NAME , tString ,READONLY)
};
statics.refl.column.pProps = createPropertyArrayHelper(
columnDef, SAL_N_ELEMENTS(columnDef) );
columnDef, std::size(columnDef) );
statics.refl.columnDescriptor.implName =
"org.openoffice.comp.pq.sdbcx.ColumnDescriptor";
@@ -255,7 +255,7 @@ Statics & getStatics()
};
statics.refl.columnDescriptor.pProps = createPropertyArrayHelper(
columnDescDef, SAL_N_ELEMENTS(columnDescDef), 0 );
columnDescDef, std::size(columnDescDef), 0 );
// Key properties
statics.refl.key.implName = "org.openoffice.comp.pq.sdbcx.Key";
@@ -271,7 +271,7 @@ Statics & getStatics()
PropertyDef( statics.UPDATE_RULE, tInt )
};
statics.refl.key.pProps = createPropertyArrayHelper(
keyDef, SAL_N_ELEMENTS(keyDef), READONLY );
keyDef, std::size(keyDef), READONLY );
// Key properties
@@ -287,7 +287,7 @@ Statics & getStatics()
PropertyDef( statics.UPDATE_RULE, tInt )
};
statics.refl.keyDescriptor.pProps = createPropertyArrayHelper(
keyDescDef, SAL_N_ELEMENTS(keyDescDef), 0 );
keyDescDef, std::size(keyDescDef), 0 );
// KeyColumn props set
@@ -310,7 +310,7 @@ Statics & getStatics()
PropertyDef( statics.TYPE_NAME , tString )
};
statics.refl.keycolumn.pProps = createPropertyArrayHelper(
keycolumnDef, SAL_N_ELEMENTS(keycolumnDef), READONLY );
keycolumnDef, std::size(keycolumnDef), READONLY );
// KeyColumn props set
statics.refl.keycolumnDescriptor.implName =
@@ -323,7 +323,7 @@ Statics & getStatics()
PropertyDef( statics.RELATED_COLUMN, tString )
};
statics.refl.keycolumnDescriptor.pProps = createPropertyArrayHelper(
keycolumnDescDef, SAL_N_ELEMENTS(keycolumnDescDef), 0 );
keycolumnDescDef, std::size(keycolumnDescDef), 0 );
// view props set
statics.refl.view.implName = "org.openoffice.comp.pq.sdbcx.View";
@@ -337,13 +337,13 @@ Statics & getStatics()
PropertyDef( statics.SCHEMA_NAME , tString )
};
statics.refl.view.pProps = createPropertyArrayHelper(
viewDef, SAL_N_ELEMENTS(viewDef), READONLY );
viewDef, std::size(viewDef), READONLY );
// view props set
statics.refl.viewDescriptor.implName = "org.openoffice.comp.pq.sdbcx.ViewDescriptor";
statics.refl.viewDescriptor.serviceNames = { "com.sun.star.sdbcx.ViewDescriptor" };
statics.refl.viewDescriptor.pProps = createPropertyArrayHelper(
viewDef, SAL_N_ELEMENTS(viewDef), 0 ); // reuse view, as it is identical
viewDef, std::size(viewDef), 0 ); // reuse view, as it is identical
// user props set
statics.refl.user.implName = "org.openoffice.comp.pq.sdbcx.User";
statics.refl.user.serviceNames = { "com.sun.star.sdbcx.User" };
@@ -352,7 +352,7 @@ Statics & getStatics()
PropertyDef( statics.NAME , tString )
};
statics.refl.user.pProps = createPropertyArrayHelper(
userDefRO, SAL_N_ELEMENTS(userDefRO), READONLY );
userDefRO, std::size(userDefRO), READONLY );
// user props set
statics.refl.userDescriptor.implName =
@@ -364,7 +364,7 @@ Statics & getStatics()
PropertyDef( statics.PASSWORD , tString )
};
statics.refl.userDescriptor.pProps = createPropertyArrayHelper(
userDefWR, SAL_N_ELEMENTS(userDefWR), 0 );
userDefWR, std::size(userDefWR), 0 );
// index props set
statics.refl.index.implName = "org.openoffice.comp.pq.sdbcx.Index";
@@ -379,14 +379,14 @@ Statics & getStatics()
PropertyDef( statics.PRIVATE_COLUMN_INDEXES, tStringSequence )
};
statics.refl.index.pProps = createPropertyArrayHelper(
indexDef, SAL_N_ELEMENTS(indexDef), READONLY );
indexDef, std::size(indexDef), READONLY );
// index props set
statics.refl.indexDescriptor.implName =
"org.openoffice.comp.pq.sdbcx.IndexDescriptor";
statics.refl.indexDescriptor.serviceNames = { "com.sun.star.sdbcx.IndexDescriptor" };
statics.refl.indexDescriptor.pProps = createPropertyArrayHelper(
indexDef, SAL_N_ELEMENTS(indexDef), 0 );
indexDef, std::size(indexDef), 0 );
// indexColumn props set
statics.refl.indexColumn.implName = "org.openoffice.comp.pq.sdbcx.IndexColumn";
@@ -408,7 +408,7 @@ Statics & getStatics()
PropertyDef( statics.TYPE_NAME , tString )
};
statics.refl.indexColumn.pProps = createPropertyArrayHelper(
indexColumnDef, SAL_N_ELEMENTS(indexColumnDef), READONLY );
indexColumnDef, std::size(indexColumnDef), READONLY );
// indexColumn props set
statics.refl.indexColumnDescriptor.implName =
@@ -421,7 +421,7 @@ Statics & getStatics()
PropertyDef( statics.NAME , tString )
};
statics.refl.indexColumnDescriptor.pProps = createPropertyArrayHelper(
indexColumnDescDef, SAL_N_ELEMENTS(indexColumnDescDef), 0 );
indexColumnDescDef, std::size(indexColumnDescDef), 0 );
// databasemetadata
statics.tablesRowNames = std::vector< OUString > ( 5 );
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index c121eb0..75acac4 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1456,7 +1456,7 @@ OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >&
{ OSQLParseNode::cast_spec, "cast_spec" },
{ OSQLParseNode::window_function, "window_function" }
};
const size_t nRuleMapCount = SAL_N_ELEMENTS( aRuleDescriptions );
const size_t nRuleMapCount = std::size( aRuleDescriptions );
// added a new rule? Adjust this map!
// +1 for UNKNOWN_RULE
static_assert(nRuleMapCount + 1 == static_cast<size_t>(OSQLParseNode::rule_count), "must be equal");
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index f7fe8db..06f0206 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -963,7 +963,7 @@ namespace cppcanvas::internal
pChars[3]=pChars[2]=pChars[1]=pChars[0];
::tools::Long nStrikeoutWidth = (rParms.mrVDev.GetTextWidth(
OUString(pChars, SAL_N_ELEMENTS(pChars))) + 2) / 4;
OUString(pChars, std::size(pChars))) + 2) / 4;
if( nStrikeoutWidth <= 0 )
nStrikeoutWidth = 1;
diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx
index 1a9ba70..0126172 100644
--- a/cppuhelper/qa/unourl/cppu_unourl.cxx
+++ b/cppuhelper/qa/unourl/cppu_unourl.cxx
@@ -67,7 +67,7 @@ namespace cppu_unourl
{ "abc,def=%22", true },
{ "abc,def=\"", true },
{ "abc,def=%ed%a0%80", true } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
try
@@ -117,7 +117,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc,def=%22" },
{ "abc,def=\"", "abc,def=\"" },
{ "abc,def=%ed%a0%80", "abc,def=%ed%a0%80" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aDescriptor;
@@ -165,7 +165,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc" },
{ "abc,def=\"", "abc" },
{ "abc,def=%ed%a0%80", "abc" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aName;
@@ -210,7 +210,7 @@ namespace cppu_unourl
{ "abc,def=xxx,ghi=xxx", "def", true },
{ "abc,def=xxx,ghi=xxx", "ghi", true },
{ "abc,def=xxx,ghi=xxx", "jkl", false } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
bool bPresent = false;
@@ -280,7 +280,7 @@ namespace cppu_unourl
{ "abc,abc=,def=Abc", "def", "Abc" },
{ "abc,abc=,def=aBC", "def", "aBC" },
{ "abc,abc=,def=ABC", "def", "ABC" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aValue;
@@ -323,7 +323,7 @@ namespace cppu_unourl
{ "uno:abc;def;1", true },
{ "uno:abc;def;$&+,/:=?@", true },
{ "uno:abc;def;%24&+,/:=?@", false } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
try
@@ -361,7 +361,7 @@ namespace cppu_unourl
{ "uno:ABC;def;ghi", "ABC" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"abc,def=xxx,ghi=xxx" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aConnection;
@@ -395,7 +395,7 @@ namespace cppu_unourl
{ "uno:abc;DEF;ghi", "DEF" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"def,ghi=xxx,jkl=xxx" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aProtocol;
@@ -432,7 +432,7 @@ namespace cppu_unourl
{ "uno:abc;def;A", "A" },
{ "uno:abc;def;1", "1" },
{ "uno:abc;def;$&+,/:=?@", "$&+,/:=?@" } };
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < std::size(aTests); ++i)
{
bool bValid = false;
OUString aObjectName;
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index 34ae388..f468518 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -142,7 +142,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
if ( hPool == nullptr )
throw BootstrapException( "cannot create random pool!" );
sal_uInt8 bytes[ 16 ];
if ( rtl_random_getBytes( hPool, bytes, SAL_N_ELEMENTS( bytes ) )
if ( rtl_random_getBytes( hPool, bytes, std::size( bytes ) )
!= rtl_Random_E_None )
throw BootstrapException( "random pool error!" );
rtl_random_destroyPool( hPool );
@@ -171,7 +171,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
// start office process
oslProcess hProcess = nullptr;
oslProcessError rc = osl_executeProcess(
OUString(path + "soffice").pData, ar_args, SAL_N_ELEMENTS( ar_args ),
OUString(path + "soffice").pData, ar_args, std::size( ar_args ),
osl_Process_DETACHED,
sec.getHandle(),
nullptr, // => current working dir
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 81d1bb1..2bfabb5 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -785,7 +785,7 @@ const sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1,
#endif
};
const sal_uInt16 KEYCODE_ARRAY_SIZE = SAL_N_ELEMENTS(KEYCODE_ARRAY);
const sal_uInt16 KEYCODE_ARRAY_SIZE = std::size(KEYCODE_ARRAY);
/** select the entry, which match the current key input ... excepting
keys, which are used for the dialog itself.
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 0bf654b..2249b70 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -405,7 +405,7 @@ void ColorConfigWindow_Impl::CreateEntries()
// creating entries
vEntries.reserve(ColorConfigEntryCount);
for (size_t i = 0; i < SAL_N_ELEMENTS(vEntryInfo); ++i)
for (size_t i = 0; i < std::size(vEntryInfo); ++i)
{
vEntries.push_back(std::make_shared<Entry>(m_pTopLevel, *m_xBuilder,
vEntryInfo[i].pText, vEntryInfo[i].pColor,
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index ed7d9fe..0940894 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -262,7 +262,7 @@ void SvxGeneralTabPage::InitControls ()
m_xBuilder->weld_label(vRowInfo[iRow].pTextId)));
Row& rRow = *vRows.back();
// fields in the row
static unsigned const nFieldCount = SAL_N_ELEMENTS(vFieldInfo);
static unsigned const nFieldCount = std::size(vFieldInfo);
// skipping other (invisible) rows
while (iField != nFieldCount && vFieldInfo[iField].eRow != eRow)
++iField;
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index ed43861..1c6eca7 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1354,7 +1354,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName(u"ProductName", CuiResId(SID_GENERAL_OPTIONS_RES[0].first));
nGroup = AddGroup(CuiResId(SID_GENERAL_OPTIONS_RES[0].first), nullptr, nullptr, SID_GENERAL_OPTIONS );
const sal_uInt16 nEnd = static_cast<sal_uInt16>(SAL_N_ELEMENTS(SID_GENERAL_OPTIONS_RES));
const sal_uInt16 nEnd = static_cast<sal_uInt16>(std::size(SID_GENERAL_OPTIONS_RES));
for (sal_uInt16 i = 1; i < nEnd; ++i)
{
@@ -1394,7 +1394,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName( u"LoadSave", CuiResId(SID_FILTER_DLG_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_FILTER_DLG_RES[0].first), nullptr, nullptr, SID_FILTER_DLG );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_FILTER_DLG_RES); ++i )
for ( size_t i = 1; i < std::size(SID_FILTER_DLG_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_FILTER_DLG_RES[i].second);
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1408,7 +1408,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first));
nGroup = AddGroup(CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first), nullptr, nullptr, SID_LANGUAGE_OPTIONS );
for (size_t i = 1; i < SAL_N_ELEMENTS(SID_LANGUAGE_OPTIONS_RES); ++i)
for (size_t i = 1; i < std::size(SID_LANGUAGE_OPTIONS_RES); ++i)
{
nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1440,7 +1440,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
else
setGroupName( u"Writer", CuiResId(SID_SW_EDITOPTIONS_RES[0].first) );
nGroup = AddGroup(CuiResId(SID_SW_EDITOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_EDITOPTIONS );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SW_EDITOPTIONS_RES); ++i )
for ( size_t i = 1; i < std::size(SID_SW_EDITOPTIONS_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1459,7 +1459,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
if ( !lcl_isOptionHidden( SID_SW_ONLINEOPTIONS, aOptionsDlgOpt ) )
{
nGroup = AddGroup(CuiResId(SID_SW_ONLINEOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_ONLINEOPTIONS );
for( size_t i = 1; i < SAL_N_ELEMENTS(SID_SW_ONLINEOPTIONS_RES); ++i )
for( size_t i = 1; i < std::size(SID_SW_ONLINEOPTIONS_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SW_ONLINEOPTIONS_RES[i].second);
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1482,7 +1482,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
SfxModule* pScMod = SfxApplication::GetModule( SfxToolsModule::Calc );
setGroupName( u"Calc", CuiResId(SID_SC_EDITOPTIONS_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_SC_EDITOPTIONS_RES[0].first), pScMod, pScMod, SID_SC_EDITOPTIONS );
const sal_uInt16 nCount = static_cast<sal_uInt16>(SAL_N_ELEMENTS(SID_SC_EDITOPTIONS_RES));
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SC_EDITOPTIONS_RES));
for ( sal_uInt16 i = 1; i < nCount; ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SC_EDITOPTIONS_RES[i].second);
@@ -1505,7 +1505,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName( u"Impress", CuiResId(SID_SD_EDITOPTIONS_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_SD_EDITOPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_EDITOPTIONS );
const sal_uInt16 nCount = static_cast<sal_uInt16>(SAL_N_ELEMENTS(SID_SD_EDITOPTIONS_RES));
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SD_EDITOPTIONS_RES));
for ( sal_uInt16 i = 1; i < nCount; ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SD_EDITOPTIONS_RES[i].second);
@@ -1527,7 +1527,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName( u"Draw", CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_SD_GRAPHIC_OPTIONS_RES[0].first), pSdMod, pSdMod, SID_SD_GRAPHIC_OPTIONS );
const sal_uInt16 nCount = static_cast<sal_uInt16>(SAL_N_ELEMENTS(SID_SD_GRAPHIC_OPTIONS_RES));
const sal_uInt16 nCount = static_cast<sal_uInt16>(std::size(SID_SD_GRAPHIC_OPTIONS_RES));
for ( sal_uInt16 i = 1; i < nCount; ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SD_GRAPHIC_OPTIONS_RES[i].second);
@@ -1550,7 +1550,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
SfxModule* pSmMod = SfxApplication::GetModule(SfxToolsModule::Math);
setGroupName( u"Math", CuiResId(SID_SM_EDITOPTIONS_RES[0].first) );
nGroup = AddGroup(CuiResId(SID_SM_EDITOPTIONS_RES[0].first), pSmMod, pSmMod, SID_SM_EDITOPTIONS );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SM_EDITOPTIONS_RES); ++i )
for ( size_t i = 1; i < std::size(SID_SM_EDITOPTIONS_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SM_EDITOPTIONS_RES[i].second);
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1569,7 +1569,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName( u"Base", CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first), nullptr, nullptr, SID_SB_STARBASEOPTIONS );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SB_STARBASEOPTIONS_RES); ++i )
for ( size_t i = 1; i < std::size(SID_SB_STARBASEOPTIONS_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SB_STARBASEOPTIONS_RES[i].second);
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1582,7 +1582,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
{
setGroupName( u"Charts", CuiResId(SID_SCH_EDITOPTIONS_RES[0].first) );
nGroup = AddGroup( CuiResId(SID_SCH_EDITOPTIONS_RES[0].first), nullptr, nullptr, SID_SCH_EDITOPTIONS );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SCH_EDITOPTIONS_RES); ++i )
for ( size_t i = 1; i < std::size(SID_SCH_EDITOPTIONS_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_SCH_EDITOPTIONS_RES[i].second);
if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
@@ -1597,7 +1597,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
setGroupName(u"Internet", CuiResId(SID_INET_DLG_RES[0].first));
nGroup = AddGroup(CuiResId(SID_INET_DLG_RES[0].first), nullptr, nullptr, SID_INET_DLG );
for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_INET_DLG_RES); ++i )
for ( size_t i = 1; i < std::size(SID_INET_DLG_RES); ++i )
{
nPageId = static_cast<sal_uInt16>(SID_INET_DLG_RES[i].second);
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index a37a145..683dd77 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1477,7 +1477,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
m_xLbLineStyle->SetSourceUnit( FieldUnit::TWIP );
for (size_t i = 0; i < SAL_N_ELEMENTS(aLines); ++i)
for (size_t i = 0; i < std::size(aLines); ++i)
{
if (!IsBorderLineStyleAllowed(aLines[i].mnStyle))
continue;
@@ -1602,7 +1602,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset )
// Check if current selection involves deletion of at least one border
bool bBorderDeletionReq = false;
for ( size_t i=0; i < SAL_N_ELEMENTS( eTypes1 ); ++i )
for ( size_t i=0; i < std::size( eTypes1 ); ++i )
{
if( pOldBoxItem->GetLine( eTypes2[i] ) || !( pOldBoxInfoItem->IsValid( eTypes1[i].second ) ) )
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 4426d9a..2c2d912 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -3032,9 +3032,9 @@ SvxCharTwoLinesPage::SvxCharTwoLinesPage(weld::Container* pPage, weld::DialogCon
, m_xStartBracketLB(m_xBuilder->weld_tree_view("startbracket"))
, m_xEndBracketLB(m_xBuilder->weld_tree_view("endbracket"))
{
for (size_t i = 0; i < SAL_N_ELEMENTS(TWOLINE_OPEN); ++i)
for (size_t i = 0; i < std::size(TWOLINE_OPEN); ++i)
m_xStartBracketLB->append(OUString::number(TWOLINE_OPEN[i].second), CuiResId(TWOLINE_OPEN[i].first));
for (size_t i = 0; i < SAL_N_ELEMENTS(TWOLINE_CLOSE); ++i)
for (size_t i = 0; i < std::size(TWOLINE_CLOSE); ++i)
m_xEndBracketLB->append(OUString::number(TWOLINE_CLOSE[i].second), CuiResId(TWOLINE_CLOSE[i].first));
m_xPreviewWin.reset(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWin));
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 63dc382..ee6d949 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -215,7 +215,7 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage(weld::Container* pPage, weld::Dia
, m_xLbLanguage(new SvxLanguageBox(m_xBuilder->weld_combo_box("languagelb")))
, m_xWndPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aWndPreview))
{
for (size_t i = 0; i < SAL_N_ELEMENTS(NUM_CATEGORIES); ++i)
for (size_t i = 0; i < std::size(NUM_CATEGORIES); ++i)
m_xLbCategory->append_text(CuiResId(NUM_CATEGORIES[i]));
auto nWidth = m_xLbCategory->get_approximate_digit_width() * 22;
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 1acd207..e7239ad 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -80,7 +80,7 @@ const SvxPageUsage aArr[] =
static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage )
{
for ( size_t i = 0; i < SAL_N_ELEMENTS(aArr); ++i )
for ( size_t i = 0; i < std::size(aArr); ++i )
if ( aArr[i] == nUsage )
return i;
return 3;
@@ -89,7 +89,7 @@ static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage )
static SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos )
{
if ( nPos >= SAL_N_ELEMENTS(aArr) )
if ( nPos >= std::size(aArr) )
return SvxPageUsage::NONE;
return aArr[nPos];
}
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 5bea85b..e0f20ab 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -383,50 +383,50 @@ static std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
return 0;
if( pMap == aVParaHtmlMap )
return SAL_N_ELEMENTS(aVParaHtmlMap);
return std::size(aVParaHtmlMap);
if( pMap == aVAsCharHtmlMap )
return SAL_N_ELEMENTS( aVAsCharHtmlMap );
return std::size( aVAsCharHtmlMap );
if( pMap == aHParaHtmlMap )
return SAL_N_ELEMENTS( aHParaHtmlMap );
return std::size( aHParaHtmlMap );
if( pMap == aHParaHtmlAbsMap )
return SAL_N_ELEMENTS( aHParaHtmlAbsMap );
return std::size( aHParaHtmlAbsMap );
if( pMap == aVPageMap )
return SAL_N_ELEMENTS( aVPageMap );
return std::size( aVPageMap );
if( pMap == aVPageHtmlMap )
return SAL_N_ELEMENTS( aVPageHtmlMap );
return std::size( aVPageHtmlMap );
if( pMap == aVAsCharMap )
return SAL_N_ELEMENTS( aVAsCharMap );
return std::size( aVAsCharMap );
if( pMap == aVParaMap )
return SAL_N_ELEMENTS( aVParaMap );
return std::size( aVParaMap );
if( pMap == aHParaMap )
return SAL_N_ELEMENTS( aHParaMap );
return std::size( aHParaMap );
if( pMap == aHFrameMap )
return SAL_N_ELEMENTS( aHFrameMap );
return std::size( aHFrameMap );
if( pMap == aVFrameMap )
return SAL_N_ELEMENTS( aVFrameMap );
return std::size( aVFrameMap );
if( pMap == aHCharMap )
return SAL_N_ELEMENTS( aHCharMap );
return std::size( aHCharMap );
if( pMap == aHCharHtmlMap )
return SAL_N_ELEMENTS( aHCharHtmlMap );
return std::size( aHCharHtmlMap );
if( pMap == aHCharHtmlAbsMap )
return SAL_N_ELEMENTS( aHCharHtmlAbsMap );
return std::size( aHCharHtmlAbsMap );
if( pMap == aVCharMap )
return SAL_N_ELEMENTS( aVCharMap );
return std::size( aVCharMap );
if( pMap == aVCharHtmlMap )
return SAL_N_ELEMENTS( aVCharHtmlMap );
return std::size( aVCharHtmlMap );
if( pMap == aVCharHtmlAbsMap )
return SAL_N_ELEMENTS( aVCharHtmlAbsMap );
return std::size( aVCharHtmlAbsMap );
if( pMap == aHPageHtmlMap )
return SAL_N_ELEMENTS( aHPageHtmlMap );
return std::size( aHPageHtmlMap );
if( pMap == aHFlyHtmlMap )
return SAL_N_ELEMENTS( aHFlyHtmlMap );
return std::size( aHFlyHtmlMap );
if( pMap == aVFlyHtmlMap )
return SAL_N_ELEMENTS( aVFlyHtmlMap );
return std::size( aVFlyHtmlMap );
if( pMap == aVMultiSelectionMap )
return SAL_N_ELEMENTS( aVMultiSelectionMap );
return std::size( aVMultiSelectionMap );
if( pMap == aHMultiSelectionMap )
return SAL_N_ELEMENTS( aHMultiSelectionMap );
return SAL_N_ELEMENTS(aHPageMap);
return std::size( aHMultiSelectionMap );
return std::size(aHPageMap);
}
static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
@@ -626,27 +626,27 @@ namespace
void SvxSwPosSizeTabPage::setOptimalFrmWidth()
{
static const FrmMaps aMaps[] = {
{ aHPageMap, SAL_N_ELEMENTS(aHPageMap) },
{ aHPageHtmlMap, SAL_N_ELEMENTS(aHPageHtmlMap) },
{ aVPageMap, SAL_N_ELEMENTS(aVPageMap) },
{ aVPageHtmlMap, SAL_N_ELEMENTS(aVPageHtmlMap) },
{ aHFrameMap, SAL_N_ELEMENTS(aHFrameMap) },
{ aHFlyHtmlMap, SAL_N_ELEMENTS(aHFlyHtmlMap) },
{ aVFrameMap, SAL_N_ELEMENTS(aVFrameMap) },
{ aVFlyHtmlMap, SAL_N_ELEMENTS(aVFlyHtmlMap) },
{ aHParaMap, SAL_N_ELEMENTS(aHParaMap) },
{ aHParaHtmlMap, SAL_N_ELEMENTS(aHParaHtmlMap) },
{ aHParaHtmlAbsMap, SAL_N_ELEMENTS(aHParaHtmlAbsMap) },
{ aVParaMap, SAL_N_ELEMENTS(aVParaMap) },
{ aVParaHtmlMap, SAL_N_ELEMENTS(aVParaHtmlMap) },
{ aHCharMap, SAL_N_ELEMENTS(aHCharMap) },
{ aHCharHtmlMap, SAL_N_ELEMENTS(aHCharHtmlMap) },
{ aHCharHtmlAbsMap, SAL_N_ELEMENTS(aHCharHtmlAbsMap) },
{ aVCharMap, SAL_N_ELEMENTS(aVCharMap) },
{ aVCharHtmlMap, SAL_N_ELEMENTS(aVCharHtmlMap) },
{ aVCharHtmlAbsMap, SAL_N_ELEMENTS(aVCharHtmlAbsMap) },
{ aVAsCharMap, SAL_N_ELEMENTS(aVAsCharMap) },
{ aVAsCharHtmlMap, SAL_N_ELEMENTS(aVAsCharHtmlMap) }
{ aHPageMap, std::size(aHPageMap) },
{ aHPageHtmlMap, std::size(aHPageHtmlMap) },
{ aVPageMap, std::size(aVPageMap) },
{ aVPageHtmlMap, std::size(aVPageHtmlMap) },
{ aHFrameMap, std::size(aHFrameMap) },
{ aHFlyHtmlMap, std::size(aHFlyHtmlMap) },
{ aVFrameMap, std::size(aVFrameMap) },
{ aVFlyHtmlMap, std::size(aVFlyHtmlMap) },
{ aHParaMap, std::size(aHParaMap) },
{ aHParaHtmlMap, std::size(aHParaHtmlMap) },
{ aHParaHtmlAbsMap, std::size(aHParaHtmlAbsMap) },
{ aVParaMap, std::size(aVParaMap) },
{ aVParaHtmlMap, std::size(aVParaHtmlMap) },
{ aHCharMap, std::size(aHCharMap) },
{ aHCharHtmlMap, std::size(aHCharHtmlMap) },
{ aHCharHtmlAbsMap, std::size(aHCharHtmlAbsMap) },
{ aVCharMap, std::size(aVCharMap) },
{ aVCharHtmlMap, std::size(aVCharHtmlMap) },
{ aVCharHtmlAbsMap, std::size(aVCharHtmlAbsMap) },
{ aVAsCharMap, std::size(aVAsCharMap) },
{ aVAsCharHtmlMap, std::size(aVAsCharHtmlMap) }
};
std::vector<SvxSwFramePosString::StringId> aFrames;
@@ -685,8 +685,8 @@ namespace
void SvxSwPosSizeTabPage::setOptimalRelWidth()
{
static const RelationMaps aMaps[] = {
{ aRelationMap, SAL_N_ELEMENTS(aRelationMap) },
{ aAsCharRelationMap, SAL_N_ELEMENTS(aAsCharRelationMap) }
{ aRelationMap, std::size(aRelationMap) },
{ aAsCharRelationMap, std::size(aAsCharRelationMap) }
};
std::vector<SvxSwFramePosString::StringId> aRels;
@@ -1644,7 +1644,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, sal_uInt16 nMapPos, sal_
if (pMap[_nMapPos].eStrId == eStrId)
{
nLBRelations = pMap[_nMapPos].nLBRelations;
for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aAsCharRelationMap); nRelPos++)
for (size_t nRelPos = 0; nRelPos < std::size(aAsCharRelationMap); nRelPos++)
{
if (nLBRelations & aAsCharRelationMap[nRelPos].nLBRelation)
{
@@ -1700,7 +1700,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, sal_uInt16 nMapPos, sal_
{
if (nLBRelations & static_cast<LB>(nBit))
{
for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aRelationMap); nRelPos++)
for (size_t nRelPos = 0; nRelPos < std::size(aRelationMap); nRelPos++)
{
if (aRelationMap[nRelPos].nLBRelation == static_cast<LB>(nBit))
{