22#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
35 =
u"Type must be css::uno::Sequence< css::beans::PropertyValue >";
43 m_aShareMutex( rMutex )
53 m_aShareMutex( rMutex )
55 if ( !rSourceContainer.is() )
58 sal_Int32
nCount = rSourceContainer->getCount();
61 for ( sal_Int32 i = 0;
i <
nCount;
i++ )
64 if ( rSourceContainer->getByIndex( i ) >>= aPropSeq )
66 sal_Int32 nContainerIndex = -1;
68 for ( sal_Int32 j = 0; j < aPropSeq.getLength(); j++ )
70 if ( aPropSeq[j].Name ==
"ItemDescriptorContainer" )
72 aPropSeq[j].Value >>= xIndexAccess;
78 if ( xIndexAccess.is() && nContainerIndex >= 0 )
79 aPropSeq.getArray()[nContainerIndex].Value <<=
deepCopyContainer( xIndexAccess, rMutex );
85 catch (
const IndexOutOfBoundsException& )
97 const sal_uInt32
nCount = rSourceVector.size();
100 sal_Int32 nContainerIndex = -1;
103 for ( sal_Int32 j = 0; j < aPropSeq.getLength(); j++ )
105 if ( aPropSeq[j].
Name ==
"ItemDescriptorContainer" )
107 aPropSeq[j].Value >>= xIndexAccess;
113 if ( xIndexAccess.is() && nContainerIndex >= 0 )
114 aPropSeq.getArray()[nContainerIndex].Value <<=
deepCopyContainer( xIndexAccess, rMutex );
123 if ( rSubContainer.is() )
131 xReturn = pSubContainer;
155 throw IndexOutOfBoundsException( OUString(),
static_cast<OWeakObject *
>(
this) );
164 if ( !(aItem >>=
aSeq) )
173 std::vector< Sequence< PropertyValue > >::iterator aIter =
m_aItemVector.begin();
178 throw IndexOutOfBoundsException( OUString(),
static_cast<OWeakObject *
>(
this) );
185 throw IndexOutOfBoundsException( OUString(),
static_cast<OWeakObject *
>(
this) );
193 if ( !(aItem >>=
aSeq) )
199 throw IndexOutOfBoundsException( OUString(),
static_cast<OWeakObject *
>(
this) );
std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual ~ItemContainer() override
virtual sal_Int32 SAL_CALL getCount() override
css::uno::Reference< css::container::XIndexAccess > deepCopyContainer(const css::uno::Reference< css::container::XIndexAccess > &rSubContainer, const ShareableMutex &rMutex)
virtual void SAL_CALL insertByIndex(sal_Int32 Index, const css::uno::Any &Element) override
ShareableMutex m_aShareMutex
ItemContainer(const ShareableMutex &)
virtual void SAL_CALL removeByIndex(sal_Int32 Index) override
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
virtual sal_Bool SAL_CALL hasElements() override
void copyItemContainer(const std::vector< css::uno::Sequence< css::beans::PropertyValue > > &rSourceVector, const ShareableMutex &rMutex)
std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector
This acts like a rtl::Reference<osl::Mutex>
constexpr OUStringLiteral WRONG_TYPE_EXCEPTION
Sequence< sal_Int8 > aSeq