diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
commit | 8c182c140ad1d45acd8c3cec4fedc1af8fcb9ba7 (patch) | |
tree | 4d2f9cdec7d8a1b0fa8672c02643f7087e13faf1 /sc/source/ui/unoobj/miscuno.cxx | |
parent | c7368b5dae43b7e1a89bb3884661439350a62cb3 (diff) | |
parent | 25b005cbda460837f063ddf996c1ec72d4f4865b (diff) |
CWS svxsplit: merge with m71
Diffstat (limited to 'sc/source/ui/unoobj/miscuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/miscuno.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index 3d41da907016..ee2a64bd8c78 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -39,6 +39,9 @@ #include "unoguard.hxx" using namespace com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::rtl::OUString; //------------------------------------------------------------------------ @@ -137,6 +140,26 @@ sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XProp return nRet; } +// static +OUString ScUnoHelpFunctions::GetStringProperty( + const Reference<beans::XPropertySet>& xProp, const OUString& rName, const OUString& rDefault ) +{ + OUString aRet = rDefault; + if (!xProp.is()) + return aRet; + + try + { + Any any = xProp->getPropertyValue(rName); + any >>= aRet; + } + catch (const uno::Exception&) + { + } + + return aRet; +} + // static sal_Bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny ) { @@ -180,6 +203,20 @@ void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) rAny.setValue( &bValue, getBooleanCppuType() ); } +// static +void ScUnoHelpFunctions::SetOptionalPropertyValue( + Reference<beans::XPropertySet>& rPropSet, const sal_Char* pPropName, const Any& rVal ) +{ + try + { + rPropSet->setPropertyValue(OUString::createFromAscii(pPropName), rVal); + } + catch (const beans::UnknownPropertyException&) + { + // ignored - not supported. + } +} + //------------------------------------------------------------------------ ScIndexEnumeration::ScIndexEnumeration(const uno::Reference<container::XIndexAccess>& rInd, |