From 4f88a1d624a97f53b58d3cdf36b2f5cfc237da59 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 2 Nov 2022 09:34:42 +0200 Subject: [PATCH] Use o3tl::to_underlying() instead of static_cast() 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 Reviewed-by: Tor Lillqvist --- stoc/source/typeconv/convert.cxx | 5 +++-- 1 file 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 #include #include +#include #include #include #include @@ -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(aDestinationClass)) + " is not supported!", + "Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) + " is not supported!", Reference(), 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(aDestinationClass)) + " is not supported!", + "Type " + OUString::number(o3tl::to_underlying(aDestinationClass)) + " is not supported!", Reference< XInterface >(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 ); }