summaryrefslogtreecommitdiff
path: root/ucbhelper/source
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2001-02-02 10:11:12 +0000
committerKai Sommerfeld <kso@openoffice.org>2001-02-02 10:11:12 +0000
commitceb671c4304f023d58f5b84f3a67ed42de676d8a (patch)
treebba1ea5e24d0e01b2fc062898e3d90e920bb0088 /ucbhelper/source
parentb97d175e929dfd80c5931f2a4df579f139c29044 (diff)
#83045# - Do not use TypeConverter service in getXXX methods to avoid
exception if property value is void.
Diffstat (limited to 'ucbhelper/source')
-rw-r--r--ucbhelper/source/provider/propertyvalueset.cxx59
1 files changed, 31 insertions, 28 deletions
diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx
index 4f943283cb8d..908363a7f625 100644
--- a/ucbhelper/source/provider/propertyvalueset.cxx
+++ b/ucbhelper/source/provider/propertyvalueset.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyvalueset.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kso $ $Date: 2001-02-02 10:43:24 $
+ * last change: $Author: kso $ $Date: 2001-02-02 11:11:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -228,39 +228,42 @@ class PropertyValues : public PropertyValuesVector {};
{ \
/* Value is available as Any. */ \
\
- /* Try to convert into native value. */ \
- if ( rValue.aObject >>= aValue ) \
+ if ( rValue.aObject.hasValue() ) \
{ \
- rValue._member_name_ = aValue; \
- rValue.nPropsSet |= _type_name_; \
- m_bWasNull = sal_False; \
- } \
- else \
- { \
- /* Last chance. Try type converter service... */ \
- \
- Reference< XTypeConverter > xConverter \
- = getTypeConverter(); \
- if ( xConverter.is() ) \
+ /* Try to convert into native value. */ \
+ if ( rValue.aObject >>= aValue ) \
{ \
- try \
+ rValue._member_name_ = aValue; \
+ rValue.nPropsSet |= _type_name_; \
+ m_bWasNull = sal_False; \
+ } \
+ else \
+ { \
+ /* Last chance. Try type converter service... */ \
+ \
+ Reference< XTypeConverter > xConverter \
+ = getTypeConverter(); \
+ if ( xConverter.is() ) \
{ \
- Any aConvAny = xConverter->convertTo( \
- rValue.aObject, \
+ try \
+ { \
+ Any aConvAny = xConverter->convertTo( \
+ rValue.aObject, \
_cppu_type_ ); \
\
- if ( aConvAny >>= aValue ) \
+ if ( aConvAny >>= aValue ) \
+ { \
+ rValue._member_name_ = aValue; \
+ rValue.nPropsSet |= _type_name_; \
+ m_bWasNull = sal_False; \
+ } \
+ } \
+ catch ( IllegalArgumentException ) \
+ { \
+ } \
+ catch ( CannotConvertException ) \
{ \
- rValue._member_name_ = aValue; \
- rValue.nPropsSet |= _type_name_; \
- m_bWasNull = sal_False; \
} \
- } \
- catch ( IllegalArgumentException ) \
- { \
- } \
- catch ( CannotConvertException ) \
- { \
} \
} \
} \