diff options
author | Thomas Benisch <tbe@openoffice.org> | 2010-02-17 16:24:29 +0100 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2010-02-17 16:24:29 +0100 |
commit | eee5ae330a49c18c4fe8666bc1c2dbc949dc0914 (patch) | |
tree | 8450428110c4300040e8d20bfba601bd231114da /sc/source/ui/unoobj/miscuno.cxx | |
parent | 6fae3f3921beb7214a77887e083852f27011179a (diff) | |
parent | 25b005cbda460837f063ddf996c1ec72d4f4865b (diff) |
chartlayout: merge with DEV300_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, |