diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h index 90107d5cbb4b..8367eca7718b 100644 --- a/include/com/sun/star/uno/Any.h +++ b/include/com/sun/star/uno/Any.h @@ -23,14 +23,13 @@ #include +#include #include #include #include #include #include -namespace rtl { class OUString; } - namespace com { namespace sun @@ -78,6 +77,11 @@ public: /// Ctor support for C++ bool. explicit inline Any( bool value ); +#if defined LIBO_INTERNAL_ONLY + template + explicit inline Any(rtl::OUStringConcat const & value); +#endif + /** Copy constructor: Sets value of the given any. @param rAny another any @@ -289,9 +293,7 @@ template<> bool Any::has() const SAL_DELETED_FUNCTION; template< class C > inline Any SAL_CALL makeAny( const C & value ); -// additionally specialized for C++ bool -template<> -inline Any SAL_CALL makeAny( bool const & value ); +template<> inline Any SAL_CALL makeAny(sal_uInt16 const & value); template<> Any SAL_CALL makeAny(Any const &) SAL_DELETED_FUNCTION; diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx index cbd8fb6e287e..d0a45061caa1 100644 --- a/include/com/sun/star/uno/Any.hxx +++ b/include/com/sun/star/uno/Any.hxx @@ -73,6 +73,11 @@ inline Any::Any( bool value ) cpp_acquire ); } +#if defined LIBO_INTERNAL_ONLY +template +Any::Any(rtl::OUStringConcat const & value): Any(rtl::OUString(value)) +{} +#endif inline Any::Any( const Any & rAny ) { @@ -183,27 +188,11 @@ inline bool Any::operator != ( const Any & rAny ) const template< class C > inline Any SAL_CALL makeAny( const C & value ) { - return Any( &value, ::cppu::getTypeFavourUnsigned(&value) ); + return Any(value); } -// additionally specialized for C++ bool - -template<> -inline Any SAL_CALL makeAny( bool const & value ) -{ - const sal_Bool b = value; - return Any( &b, cppu::UnoType::get() ); -} - - -#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" -template< class C1, class C2 > -inline Any SAL_CALL makeAny( const rtl::OUStringConcat< C1, C2 >& value ) -{ - const rtl::OUString str( value ); - return Any( &str, ::cppu::getTypeFavourUnsigned(&str) ); -} -#endif +template<> Any makeAny(sal_uInt16 const & value) +{ return Any(&value, cppu::UnoType::get()); } template Any toAny(T const & value) { return makeAny(value); }