diff options
author | Kohei Yoshida <kohei@openoffice.org> | 2009-07-31 18:40:28 +0000 |
---|---|---|
committer | Kohei Yoshida <kohei@openoffice.org> | 2009-07-31 18:40:28 +0000 |
commit | e4228cc6472975a438aaa428a3562bd727c4a83f (patch) | |
tree | 98da6ca6f24f0fc375bbd0274eb42d8b002f06f1 /sc/inc/miscuno.hxx | |
parent | 140a7e79d697b679c5c2a3b5ffe00c91f8cb9585 (diff) |
Handle optional property values of DataPilotSource more gracefully. We need to allow the data provider to not support those optional properties.
Diffstat (limited to 'sc/inc/miscuno.hxx')
-rw-r--r-- | sc/inc/miscuno.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx index 1486d3ce480b..7f6bd4774faf 100644 --- a/sc/inc/miscuno.hxx +++ b/sc/inc/miscuno.hxx @@ -291,6 +291,20 @@ public: static sal_Int32 GetInt32FromAny( const com::sun::star::uno::Any& aAny ); static sal_Int32 GetEnumFromAny( const com::sun::star::uno::Any& aAny ); static void SetBoolInAny( com::sun::star::uno::Any& rAny, sal_Bool bValue ); + + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ::com::sun::star::uno::Any& rVal ); + + template<typename ValueType> + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ValueType& rVal ) + { + ::com::sun::star::uno::Any any; + any <<= rVal; + SetOptionalPropertyValue(rPropSet, pPropName, any); + } }; |