summaryrefslogtreecommitdiff
path: root/xmloff/source/style/EnumPropertyHdl.cxx
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2000-12-07 18:17:02 +0000
committerChristian Lippka <cl@openoffice.org>2000-12-07 18:17:02 +0000
commit24e4996823959dd5d098e46db56b1938722c79c8 (patch)
tree4f7eb7d27f8b17fb69495499cc31321bcf495367 /xmloff/source/style/EnumPropertyHdl.cxx
parentbb5b411d20cf7c2038f4b2712275abb90d015656 (diff)
#80678# EnumPropertyHdl now even works with non enum types
Diffstat (limited to 'xmloff/source/style/EnumPropertyHdl.cxx')
-rw-r--r--xmloff/source/style/EnumPropertyHdl.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx
index e1f38153c169..e9a8ba60764e 100644
--- a/xmloff/source/style/EnumPropertyHdl.cxx
+++ b/xmloff/source/style/EnumPropertyHdl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: EnumPropertyHdl.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:07:04 $
+ * last change: $Author: cl $ $Date: 2000-12-07 19:17:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,10 @@
*
************************************************************************/
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
#ifndef _XMLOFF_ENUMPROPERTYHANDLER_HXX
#include <EnumPropertyHdl.hxx>
#endif
@@ -121,7 +125,24 @@ sal_Bool XMLEnumPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValu
if( SvXMLUnitConverter::convertEnum( nValue, rStrImpValue, mpEnumMap ) )
{
- rValue = ::cppu::int2enum( nValue, mrType );
+ switch( mrType.getTypeClass() )
+ {
+ case TypeClass_ENUM:
+ rValue = ::cppu::int2enum( nValue, mrType );
+ break;
+ case TypeClass_LONG:
+ rValue <<= (sal_Int32) nValue;
+ break;
+ case TypeClass_SHORT:
+ rValue <<= (sal_Int16) nValue;
+ break;
+ case TypeClass_BYTE:
+ rValue <<= (sal_Int8) nValue;
+ break;
+ default:
+ DBG_ERROR( "Wrong type for enum property handler!" );
+ return sal_False;
+ }
return sal_True;
}