summaryrefslogtreecommitdiff
path: root/include/com
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-03 22:07:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-03 21:52:12 +0000
commitdcfc07842be6ef540845413f17739747359ef1f8 (patch)
treedf9c1583cd2f1c682996a7c4a777ea88bbf44f78 /include/com
parentfac5f2af5190e6da9bedfcdf02426be59ad99166 (diff)
Enable Any functions on sal_uInt16 for LIBO_INTERNAL_ONLY
...where sal_uInt16 no longer clashes with sal_Unicode after e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 type on windows". This allows to consistently use Any ctor instead of makeAny, regardless of argument type, in LIBO_INTERNAL_ONLY code. Change-Id: I9acdcc48be71a90d17013959c8275454e8fa01a0 Reviewed-on: https://gerrit.libreoffice.org/24620 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/com')
-rw-r--r--include/com/sun/star/uno/Any.h6
-rw-r--r--include/com/sun/star/uno/Any.hxx2
2 files changed, 8 insertions, 0 deletions
diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 8367eca7718b..7ed67e2ab4e0 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -267,17 +267,21 @@ public:
inline bool SAL_CALL operator != ( const Any & rAny ) const;
private:
+#if !defined LIBO_INTERNAL_ONLY
/// @cond INTERNAL
// Forbid use with ambiguous type (sal_Unicode, sal_uInt16):
explicit Any(sal_uInt16) SAL_DELETED_FUNCTION;
/// @endcond
+#endif
};
+#if !defined LIBO_INTERNAL_ONLY
/// @cond INTERNAL
// Forbid use with ambiguous type (sal_Unicode, sal_uInt16):
template<> sal_uInt16 Any::get<sal_uInt16>() const SAL_DELETED_FUNCTION;
template<> bool Any::has<sal_uInt16>() const SAL_DELETED_FUNCTION;
/// @endcond
+#endif
/** Template function to generically construct an any from a C++ value.
@@ -293,7 +297,9 @@ template<> bool Any::has<sal_uInt16>() const SAL_DELETED_FUNCTION;
template< class C >
inline Any SAL_CALL makeAny( const C & value );
+#if !defined LIBO_INTERNAL_ONLY
template<> inline Any SAL_CALL makeAny(sal_uInt16 const & value);
+#endif
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 d0a45061caa1..8859fa76809b 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -191,8 +191,10 @@ inline Any SAL_CALL makeAny( const C & value )
return Any(value);
}
+#if !defined LIBO_INTERNAL_ONLY
template<> Any makeAny(sal_uInt16 const & value)
{ return Any(&value, cppu::UnoType<cppu::UnoUnsignedShortType>::get()); }
+#endif
template<typename T> Any toAny(T const & value) { return makeAny(value); }