diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 09:35:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 14:17:14 +0200 |
commit | b70fa47aec65fe95da94fc17640dda27650e9677 (patch) | |
tree | 7e54f37342fd57c324f43d54659335554a9c8e72 /toolkit | |
parent | 6db84250d1c4e7ec5a54ff75e124ea9a84ff89d9 (diff) |
use more SAL_N_ELEMENTS part 1
- teach comphelper::containerToSequence to handle sized arrays
- also use range based for-loop where appropriate.
Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99
Reviewed-on: https://gerrit.libreoffice.org/38769
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxprinter.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/helper/property.cxx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index fe4a8f089fe1..b2f3ac103bba 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -55,7 +55,7 @@ css::beans::Property* ImplGetProperties( sal_uInt16& rElementCount ) css::beans::Property( "Horizontal", PROPERTY_Horizontal, cppu::UnoType<bool>::get(), 0 ) }; pProperties = aPropTable; - nElements = sizeof( aPropTable ) / sizeof( css::beans::Property ); + nElements = SAL_N_ELEMENTS( aPropTable ); } } rElementCount = nElements; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 5c781f5ef6ab..380abb76af30 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -511,7 +511,7 @@ WindowType ImplGetComponentType( const OUString& rServiceName ) if( !bSorted ) { qsort( static_cast<void*>(aComponentInfos), - sizeof( aComponentInfos ) / sizeof( ComponentInfo ), + SAL_N_ELEMENTS( aComponentInfos ), sizeof( ComponentInfo ), ComponentInfoCompare ); bSorted = true; @@ -527,7 +527,7 @@ WindowType ImplGetComponentType( const OUString& rServiceName ) ComponentInfo* pInf = static_cast<ComponentInfo*>(bsearch( &aSearch, static_cast<void*>(aComponentInfos), - sizeof( aComponentInfos ) / sizeof( ComponentInfo ), + SAL_N_ELEMENTS( aComponentInfos ), sizeof( ComponentInfo ), ComponentInfoCompare )); diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 7b98d1d80611..3ace75837bcb 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -285,7 +285,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_3 ( "InactiveSelectionTextColor", INACTIVE_SEL_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), }; pPropertyInfos = aImplPropertyInfos; - nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo ); + nElements = SAL_N_ELEMENTS( aImplPropertyInfos ); } } rElementCount = nElements; |