From 06c1dc4c09ba816affb8b65e8215bcd56a81df91 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 28 Apr 2017 14:09:57 +0200 Subject: LIBO_INTERNAL_ONLY: printing of css::uno::Reference/Type ...as will be needed by some upcoming replacements of CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Ie2b2b982b02f2bf48e2e8be7ba642198029c8698 --- include/com/sun/star/uno/Reference.hxx | 14 ++++++++++++++ include/com/sun/star/uno/Type.hxx | 13 +++++++++++++ 2 files changed, 27 insertions(+) (limited to 'include') diff --git a/include/com/sun/star/uno/Reference.hxx b/include/com/sun/star/uno/Reference.hxx index c4708f1956b9..f197007cb8ff 100644 --- a/include/com/sun/star/uno/Reference.hxx +++ b/include/com/sun/star/uno/Reference.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -432,6 +433,19 @@ inline bool BaseReference::operator != ( const BaseReference & rRef ) const return (! operator == ( rRef._pInterface )); } +#if defined LIBO_INTERNAL_ONLY +/** + Support for BaseReference in std::ostream (and thus in CPPUNIT_ASSERT or + SAL_INFO macros, for example). + + @since LibreOffice 5.4 +*/ +template std::basic_ostream & +operator <<( + std::basic_ostream & stream, BaseReference const & ref) +{ return stream << ref.get(); } +#endif + } } } diff --git a/include/com/sun/star/uno/Type.hxx b/include/com/sun/star/uno/Type.hxx index 36800ce7be78..4a7b86e72c05 100644 --- a/include/com/sun/star/uno/Type.hxx +++ b/include/com/sun/star/uno/Type.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -92,6 +93,18 @@ inline Type & Type::operator = ( const Type & rType ) template< class T > typelib_TypeDescriptionReference * Array< T >::s_pType = NULL; +#if defined LIBO_INTERNAL_ONLY +/** + Support for Type in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO + macros, for example). + + @since LibreOffice 5.4 +*/ +template std::basic_ostream & +operator <<(std::basic_ostream & stream, Type const & type) +{ return stream << type.getTypeName(); } +#endif + } } } -- cgit