diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-03-29 10:25:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-31 11:30:36 +0200 |
commit | 6439005484bdf6754b910b1ce025b3fb33b6623f (patch) | |
tree | 1a00f48ae11d3da3d928f2d3d68b3e299216328c /ucb | |
parent | 1aa4df615fa5599d05e9dd5e925b5852676185fa (diff) |
use SAL_N_ELEMENTS more widely
found using
git grep -n 'sizeof.*/.*sizeof.*[0]'
Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/ext/ucpext_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontentcaps.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_contentcaps.cxx | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index 72c58379e14e..c9f853e0ef8c 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -614,7 +614,7 @@ namespace ucb { namespace ucp { namespace ext PropertyAttribute::BOUND | PropertyAttribute::READONLY ) }; - return Sequence< Property >( aProperties, sizeof( aProperties ) / sizeof( aProperties[0] ) ); + return Sequence< Property >( aProperties, SAL_N_ELEMENTS( aProperties ) ); } diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 5305486ab933..d1f45e91e52d 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -1266,7 +1266,7 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) }; - const int nProps = sizeof (aGenericProperties) / sizeof (aGenericProperties[0]); + const int nProps = SAL_N_ELEMENTS(aGenericProperties); return uno::Sequence< beans::Property > ( aGenericProperties, nProps ); } @@ -1308,7 +1308,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< uc -1, cppu::UnoType<ucb::ContentInfo>::get() ) }; - const int nProps = sizeof (aCommandInfoTable) / sizeof (aCommandInfoTable[0]); + const int nProps = SAL_N_ELEMENTS(aCommandInfoTable); return uno::Sequence< ucb::CommandInfo >(aCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 2); } diff --git a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx index b30465ed1076..c8094aef3d35 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -66,10 +66,10 @@ using namespace hierarchy_ucp; #define MAKEPROPSEQUENCE( a ) \ - uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + uno::Sequence< beans::Property >( a, SAL_N_ELEMENTS( a ) ) #define MAKECMDSEQUENCE( a ) \ - uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + uno::Sequence< ucb::CommandInfo >( a, SAL_N_ELEMENTS( a ) ) // IMPORTANT: If any property data ( name / type / ... ) are changed, then diff --git a/ucb/source/ucp/package/pkgcontentcaps.cxx b/ucb/source/ucp/package/pkgcontentcaps.cxx index 1234293b96cf..9e6988e60018 100644 --- a/ucb/source/ucp/package/pkgcontentcaps.cxx +++ b/ucb/source/ucp/package/pkgcontentcaps.cxx @@ -67,10 +67,10 @@ using namespace package_ucp; #define MAKEPROPSEQUENCE( a ) \ - uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + uno::Sequence< beans::Property >( a, SAL_N_ELEMENTS( a ) ) #define MAKECMDSEQUENCE( a ) \ - uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + uno::Sequence< ucb::CommandInfo >( a, SAL_N_ELEMENTS( a ) ) // IMPORTANT: If any property data ( name / type / ... ) are changed, then diff --git a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx index ed469afbc858..254cb27a7cd9 100644 --- a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx +++ b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx @@ -77,10 +77,10 @@ using namespace tdoc_ucp; #define MAKEPROPSEQUENCE( a ) \ - uno::Sequence< beans::Property >( a, (sizeof (a) / sizeof (a[0])) ) + uno::Sequence< beans::Property >( a, SAL_N_ELEMENTS(a) ) #define MAKECMDSEQUENCE( a ) \ - uno::Sequence< ucb::CommandInfo >( a, (sizeof (a) / sizeof (a[0])) ) + uno::Sequence< ucb::CommandInfo >( a, SAL_N_ELEMENTS(a) ) // IMPORTANT: If any property data ( name / type / ... ) are changed, then |