summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-04 17:32:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-04 17:39:06 +0200
commiteda7d3cc451d3baa12c38057721d5c50862a51dd (patch)
tree9923a64bcdd102570cee955895819b58b8b59858
parent92a2bb96491b7f12c97474192f47d44683b6245c (diff)
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
-rw-r--r--include/cppuhelper/proptypehlp.h1
-rw-r--r--include/cppuhelper/proptypehlp.hxx6
2 files changed, 7 insertions, 0 deletions
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();