From eda7d3cc451d3baa12c38057721d5c50862a51dd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 4 May 2016 17:32:02 +0200 Subject: Add covertPropertyValue bool overload ...as the behavior of the generic covertPropertyValue template instantiated for bool would be quite different from the behavior of the convertPropertyValue sal_Bool overload, leading to potential surprises. (Though it seems there were no uses yet of covertPropertyValue with bool, only with sal_Bool.) Change-Id: I107a0608fc4271e95464a7f9bdc340a9e6dc1336 --- include/cppuhelper/proptypehlp.h | 1 + include/cppuhelper/proptypehlp.hxx | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'include/cppuhelper') diff --git a/include/cppuhelper/proptypehlp.h b/include/cppuhelper/proptypehlp.h index b76279f02c29..d163831e66bc 100644 --- a/include/cppuhelper/proptypehlp.h +++ b/include/cppuhelper/proptypehlp.h @@ -38,6 +38,7 @@ inline void SAL_CALL convertPropertyValue( target &value , const css::uno::Any conversion of basic types */ inline void SAL_CALL convertPropertyValue( sal_Bool & target , const css::uno::Any & source ); +inline void SAL_CALL convertPropertyValue( bool & target , const css::uno::Any & source ); inline void SAL_CALL convertPropertyValue( sal_Int64 & target , const css::uno::Any & source ); inline void SAL_CALL convertPropertyValue( sal_uInt64 & target, const css::uno::Any & source ); inline void SAL_CALL convertPropertyValue( sal_Int32 & target , const css::uno::Any & source ); diff --git a/include/cppuhelper/proptypehlp.hxx b/include/cppuhelper/proptypehlp.hxx index 4079e887c499..5169c5b47a5a 100644 --- a/include/cppuhelper/proptypehlp.hxx +++ b/include/cppuhelper/proptypehlp.hxx @@ -87,6 +87,12 @@ inline void SAL_CALL convertPropertyValue( sal_Bool & b , const css::uno::Any } } +void convertPropertyValue(bool & target, css::uno::Any const & source) { + sal_Bool b; + convertPropertyValue(b, source); + target = b; +} + inline void SAL_CALL convertPropertyValue( sal_Int64 & i , const css::uno::Any & a ) { const enum css::uno::TypeClass tc = a.getValueType().getTypeClass(); -- cgit