mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-20 18:18:30 +00:00
tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I6cdcfbb0f314fa916e2bb6846409174eb8bad6e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188070 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:

committed by
Ilmari Lauhakangas

parent
3a2b9f384c
commit
083d833b59
@ -33,6 +33,7 @@
|
||||
#include <sal/config.h>
|
||||
#include <sal/macros.h>
|
||||
#include <memory>
|
||||
#include <iterator>
|
||||
|
||||
#if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
|
||||
#include <stdarg.h>
|
||||
@ -980,7 +981,7 @@ OUString Sane::GetOptionUnitName( int n )
|
||||
OUString aText;
|
||||
SANE_Unit nUnit = mppOptions[n]->unit;
|
||||
size_t nUnitAsSize = static_cast<size_t>(nUnit);
|
||||
if (nUnitAsSize >= SAL_N_ELEMENTS( ppUnits ))
|
||||
if (nUnitAsSize >= std::size( ppUnits ))
|
||||
aText = "[unknown units]";
|
||||
else
|
||||
aText = OUString( ppUnits[ nUnit ], strlen(ppUnits[ nUnit ]), osl_getThreadTextEncoding() );
|
||||
|
Reference in New Issue
Block a user