include/comphelper/extract.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit 00a45faf5ef929572c6f0df686716aec991503be Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon May 30 18:31:43 2016 +0200 Fix int2enum * The data argument to the Any ctor call needs to point at sal_Int32, not int. * All calls to int2enum guarantee that rType is an enum type, so assert that. Change-Id: I0ccd498420638fee80aeeccc93d9c1e3309f83b0 diff --git a/include/comphelper/extract.hxx b/include/comphelper/extract.hxx index 4584954..2b5ae0a 100644 --- a/include/comphelper/extract.hxx +++ b/include/comphelper/extract.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_COMPHELPER_EXTRACT_HXX #define INCLUDED_COMPHELPER_EXTRACT_HXX +#include <sal/config.h> + +#include <cassert> + #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/uno/TypeClass.hpp> #include <com/sun/star/uno/Type.hxx> @@ -38,12 +42,8 @@ namespace cppu inline css::uno::Any SAL_CALL int2enum( sal_Int32 nEnum, const css::uno::Type & rType ) { - if (rType.getTypeClass() == css::uno::TypeClass_ENUM) - { - int nVal = nEnum; - return css::uno::Any( &nVal, rType ); - } - return css::uno::Any(); + assert(rType.getTypeClass() == css::uno::TypeClass_ENUM); + return css::uno::Any( &nEnum, rType ); } /** _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits