diff options
author | Kayo Hamid <revol.code@yahoo.com> | 2010-10-14 21:14:52 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-14 21:15:24 +0100 |
commit | b7c82daa28526c566047e158ab2ace522fc442dc (patch) | |
tree | c71f33ee622add8de9013a170a7463ed564ad6e8 /ucb/source | |
parent | 1b0c6da1c3bcc6a9c1412d221d029885f9998fa1 (diff) |
Switch to use SAL_N_ELEMENTS macro, everywhere
Diffstat (limited to 'ucb/source')
-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/gvfs/gvfs_content.cxx | 5 | ||||
-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 |
6 files changed, 11 insertions, 12 deletions
diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index b6a3adb89576..f1e2b0347634 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -620,7 +620,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 b8ed01b9ed8e..cfdd14b70773 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -1255,7 +1255,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 ); } @@ -1297,7 +1297,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< uc -1, getCppuType( static_cast<ucb::ContentInfo * >( 0 ) ) ) }; - 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/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 748751f34de1..a9f94f0768e0 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -1355,7 +1355,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 ); @@ -1399,8 +1399,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( -1, getCppuType( static_cast<ucb::ContentInfo * >( 0 ) ) ) }; - 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 4dbbd97e6298..aae23c0adf18 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -78,10 +78,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 ) ) //========================================================================= // diff --git a/ucb/source/ucp/package/pkgcontentcaps.cxx b/ucb/source/ucp/package/pkgcontentcaps.cxx index 9b8e0e51b146..84eabe6f5b37 100644 --- a/ucb/source/ucp/package/pkgcontentcaps.cxx +++ b/ucb/source/ucp/package/pkgcontentcaps.cxx @@ -79,10 +79,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 ) ) //========================================================================= // diff --git a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx index 2bf29b150ed5..bd8ed490fb8d 100644 --- a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx +++ b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx @@ -89,10 +89,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_ELEMTS( a ) ) #define MAKECMDSEQUENCE( a ) \ - uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + uno::Sequence< ucb::CommandInfo >( a, SAL_N_ELEMENTS( a ) ) //========================================================================= // |