diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-30 14:31:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-30 14:31:24 +0200 |
commit | e630df7853a62225cd77fc4262689ef5607d2907 (patch) | |
tree | 7d9f994e96f9f2d14c26dccbca622ad147567a69 /stoc | |
parent | 46d5d475b114b93a76502d58637468e404a8562b (diff) |
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
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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<const OUString *>(rVal.getValue())).getLength() == 1) // single char - aRet.setValue( (*static_cast<const OUString *>(rVal.getValue())).getStr(), cppu::UnoType<cppu::UnoCharType>::get() ); + auto const s = static_cast<const OUString *>(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<cppu::UnoCharType>::get() ); + aRet <<= sal_Unicode(toHyper( rVal, 0, 0xffff )); // range } break; } |