diff options
author | Tor Lillqvist <tml@collabora.com> | 2022-11-02 09:34:42 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2022-11-02 11:21:21 +0100 |
commit | 4f88a1d624a97f53b58d3cdf36b2f5cfc237da59 (patch) | |
tree | 638713ac23719657637d5f42bb79cf4984d86c32 /stoc | |
parent | c4f5d456e5801843f00a43afd9c0fa43c412d265 (diff) |
Use o3tl::to_underlying() instead of static_cast<int>()
sberg says it is better, and I trust him.
Change-Id: I32b343cd899f807c0eb803e74e856b0eb9610074
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142132
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index 445163f923f1..51b857b424c6 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -22,6 +22,7 @@ #include <o3tl/any.hxx> #include <o3tl/safeint.hxx> #include <o3tl/string_view.hxx> +#include <o3tl/underlyingenumvalue.hxx> #include <osl/diagnose.h> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> @@ -359,7 +360,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6 default: throw CannotConvertException( - "Type " + OUString::number(static_cast<int>(aDestinationClass)) + " is not supported!", + "Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) + " is not supported!", Reference<XInterface>(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 ); } @@ -439,7 +440,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) default: throw CannotConvertException( - "Type " + OUString::number(static_cast<int>(aDestinationClass)) + " is not supported!", + "Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) + " is not supported!", Reference< XInterface >(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 ); } |