summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-12-02 22:33:47 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-03 18:04:24 +0100
commit249f09885bc06f580ec3aea5ccd7a09d8e91541d (patch)
tree239ecb9f1ab1c929986970b307f8ce091ee49225 /cppu
parentc94b9c48664062396e9f8a12176970f6c90c0003 (diff)
make sure uno::Any works with fast operator+
The result of the operation needs to be first converted to O(U)String. Change-Id: I24dafeaebf68a0eff3edf1d1cf713bfc10bbd8f4
Diffstat (limited to 'cppu')
-rw-r--r--cppu/inc/com/sun/star/uno/Any.hxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/cppu/inc/com/sun/star/uno/Any.hxx b/cppu/inc/com/sun/star/uno/Any.hxx
index beeed811a2d6..8f6dfc61cfdf 100644
--- a/cppu/inc/com/sun/star/uno/Any.hxx
+++ b/cppu/inc/com/sun/star/uno/Any.hxx
@@ -188,6 +188,23 @@ inline Any SAL_CALL makeAny( bool const & value ) SAL_THROW(())
}
//__________________________________________________________________________________________________
+#ifdef RTL_FAST_STRING
+template< class C1, class C2 >
+inline Any SAL_CALL makeAny( const rtl::OStringConcat< C1, C2 >& value ) SAL_THROW(())
+{
+ const rtl::OString str( value );
+ return Any( &str, ::cppu::getTypeFavourUnsigned(&str) );
+}
+
+//__________________________________________________________________________________________________
+template< class C1, class C2 >
+inline Any SAL_CALL makeAny( const rtl::OUStringConcat< C1, C2 >& value ) SAL_THROW(())
+{
+ const rtl::OUString str( value );
+ return Any( &str, ::cppu::getTypeFavourUnsigned(&str) );
+}
+#endif
+//__________________________________________________________________________________________________
template< class C >
inline void SAL_CALL operator <<= ( Any & rAny, const C & value ) SAL_THROW(())
{
@@ -208,6 +225,31 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
(uno_AcquireFunc) cpp_acquire, (uno_ReleaseFunc) cpp_release );
}
+//______________________________________________________________________________
+#ifdef RTL_FAST_STRING
+template< class C1, class C2 >
+inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OStringConcat< C1, C2 >& value )
+ SAL_THROW(())
+{
+ const rtl::OString str( value );
+ const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
+ ::uno_type_any_assign(
+ &rAny, const_cast< rtl::OString * >( &str ), rType.getTypeLibType(),
+ (uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
+}
+
+//______________________________________________________________________________
+template< class C1, class C2 >
+inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, C2 >& value )
+ SAL_THROW(())
+{
+ const rtl::OUString str( value );
+ const Type & rType = ::cppu::getTypeFavourUnsigned(&str);
+ ::uno_type_any_assign(
+ &rAny, const_cast< rtl::OUString * >( &str ), rType.getTypeLibType(),
+ (uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
+}
+#endif
//__________________________________________________________________________________________________
template< class C >
inline sal_Bool SAL_CALL operator >>= ( const Any & rAny, C & value ) SAL_THROW(())