22#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
31using ::com::sun::star::uno::Reference;
32using ::com::sun::star::uno::Any;
37 const OUString& rName,
bool bDefault )
44 xProp->getPropertyValue( rName ) >>= bRet;
46 catch(uno::Exception&)
55 const OUString& rName, sal_Int16 nDefault )
57 sal_Int16 nRet = nDefault;
62 xProp->getPropertyValue( rName ) >>= nRet;
64 catch(uno::Exception&)
73 const OUString& rName )
81 xProp->getPropertyValue( rName ) >>= nRet;
83 catch(uno::Exception&)
92 const OUString& rName, sal_Int32 nDefault )
94 sal_Int32 nRet = nDefault;
99 uno::Any aAny(xProp->getPropertyValue( rName ));
101 if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM )
104 nRet = *
static_cast<sal_Int32
const *
>(aAny.getValue());
112 catch(uno::Exception&)
121 const Reference<beans::XPropertySet>& xProp,
const OUString& rName,
const OUString& rDefault )
123 OUString aRet = rDefault;
129 Any any = xProp->getPropertyValue(rName);
132 catch (
const uno::Exception&)
164 if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM )
165 nRet = *
static_cast<sal_Int32
const *
>(aAny.getValue());
172 const Reference<beans::XPropertySet>& rPropSet,
const char* pPropName,
const Any& rVal )
178 const Reference<beans::XPropertySet>& rPropSet,
const OUString& sPropName,
const Any& rVal )
182 rPropSet->setPropertyValue(sPropName, rVal);
184 catch (
const beans::UnknownPropertyException&)
191 OUString aServiceName) :
192 xIndex(
std::move( xInd )),
207 return ( nPos < xIndex->getCount() );
218 catch (lang::IndexOutOfBoundsException&)
220 throw container::NoSuchElementException();
227 return "ScIndexEnumeration";
235css::uno::Sequence< OUString >
242 css::container::XNameAccess> xNameObj ) :
243 xNameAccess(
std::move( xNameObj ))
259 return aNames.getLength();
267 throw lang::IndexOutOfBoundsException();
constexpr OUStringLiteral sServiceName
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL hasMoreElements() override
ScIndexEnumeration(css::uno::Reference< css::container::XIndexAccess > xInd, OUString aServiceName)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Any SAL_CALL nextElement() override
virtual ~ScIndexEnumeration() override
css::uno::Reference< css::container::XIndexAccess > xIndex
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Int32 SAL_CALL getCount() override
ScNameToIndexAccess(css::uno::Reference< css::container::XNameAccess > xNameObj)
virtual css::uno::Type SAL_CALL getElementType() override
css::uno::Sequence< OUString > aNames
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual ~ScNameToIndexAccess() override
virtual sal_Bool SAL_CALL hasElements() override
css::uno::Reference< css::container::XNameAccess > xNameAccess
static sal_Int32 GetEnumPropertyImpl(const css::uno::Reference< css::beans::XPropertySet > &xProp, const OUString &rName, sal_Int32 nDefault)
static sal_Int32 GetInt32FromAny(const css::uno::Any &aAny)
static sal_Int16 GetInt16FromAny(const css::uno::Any &aAny)
static sal_Int16 GetShortProperty(const css::uno::Reference< css::beans::XPropertySet > &xProp, const OUString &rName, sal_Int16 nDefault)
static OUString GetStringProperty(const css::uno::Reference< css::beans::XPropertySet > &xProp, const OUString &rName, const OUString &rDefault)
static void SetOptionalPropertyValue(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const char *pPropName, const css::uno::Any &rVal)
static sal_Int32 GetEnumFromAny(const css::uno::Any &aAny)
static bool GetBoolFromAny(const css::uno::Any &aAny)
static sal_Int32 GetLongProperty(const css::uno::Reference< css::beans::XPropertySet > &xProp, const OUString &rName)
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)