sw/source/ui/vba/vbaborders.cxx | 2 +- sw/source/ui/vba/vbapalette.cxx | 2 +- sw/source/ui/vba/vbasystem.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 45c440031751d75ada85208438340dfc6ba3664f Author: mkt1 <[email protected]> AuthorDate: Sat Sep 27 00:25:44 2025 -0700 Commit: Hossein <[email protected]> CommitDate: Wed Oct 15 17:00:33 2025 +0200 tdf#147021 Use std::size() / std::ssize() instead of SAL_N_ELEMENTS() macro Also used static_cast instead of C style casting Change-Id: Ia6d6f93c7c8c7707f3cb93bfac336b9e586207e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191560 Tested-by: Jenkins Reviewed-by: Hossein <[email protected]> diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx index 89fc7c011688..007e9231addb 100644 --- a/sw/source/ui/vba/vbaborders.cxx +++ b/sw/source/ui/vba/vbaborders.cxx @@ -251,7 +251,7 @@ public: // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) override { - return SAL_N_ELEMENTS( supportedIndexTable ); + return std::ssize( supportedIndexTable ); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override { diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx index 351f2711c586..5d113e7deb43 100644 --- a/sw/source/ui/vba/vbapalette.cxx +++ b/sw/source/ui/vba/vbapalette.cxx @@ -60,7 +60,7 @@ public: // Methods XIndexAccess virtual ::sal_Int32 SAL_CALL getCount() override { - return SAL_N_ELEMENTS(ColorTable); + return std::ssize(ColorTable); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx index 7bd0e54957e1..02dd5f94bf80 100644 --- a/sw/source/ui/vba/vbasystem.cxx +++ b/sw/source/ui/vba/vbasystem.cxx @@ -108,7 +108,7 @@ uno::Any PrivateProfileStringListener::getValueEvent() RegCloseKey( hKey ); // https://msdn.microsoft.com/en-us/ms724911 mentions that // "the string may not have been stored with the proper terminating null characters" - szBuffer[std::min(size_t(cbData / sizeof(szBuffer[0])), SAL_N_ELEMENTS(szBuffer)-1)] = 0; + szBuffer[std::min(static_cast<size_t>(cbData) / sizeof(DWORD), std::size(szBuffer)-1)] = 0; sValue = o3tl::toU(szBuffer); } }
