From e630df7853a62225cd77fc4262689ef5607d2907 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 30 May 2016 14:31:24 +0200 Subject: Just use Any::operator <<= for sal_Unicode values ...now that sal_Unicode no longer clashes with sal_uInt16 on any platform (in LIBO_INTERNAL_ONLY code), after e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 type on windows" Change-Id: Id423dd6235bf14823fa5611b804c0974edbe64b3 --- stoc/source/typeconv/convert.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'stoc') diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index e7795c5fc66a..2a6cc736a557 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -761,14 +761,14 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina { if (aSourceClass==TypeClass_STRING) { - if ((*static_cast(rVal.getValue())).getLength() == 1) // single char - aRet.setValue( (*static_cast(rVal.getValue())).getStr(), cppu::UnoType::get() ); + auto const s = static_cast(rVal.getValue()); + if (s->getLength() == 1) // single char + aRet <<= (*s)[0]; } else if (aSourceClass!=TypeClass_ENUM && // exclude enums, chars aSourceClass!=TypeClass_CHAR) { - sal_Unicode cRet = (sal_Unicode)toHyper( rVal, 0, 0xffff ); // range - aRet.setValue( &cRet, cppu::UnoType::get() ); + aRet <<= sal_Unicode(toHyper( rVal, 0, 0xffff )); // range } break; } -- cgit v1.2.3