29class FileDialogItemEnumeration :
public ::cppu::WeakImplHelper< container::XEnumeration >
31 std::vector< OUString > m_sItems;
32 std::vector< OUString >::iterator mIt;
34 explicit FileDialogItemEnumeration( std::vector< OUString >&& rVector ) : m_sItems(
std::move(rVector) ), mIt( m_sItems.
begin() ) {}
35 virtual sal_Bool SAL_CALL hasMoreElements()
override
37 return ( mIt != m_sItems.end() );
39 virtual uno::Any SAL_CALL nextElement()
override
41 if( !hasMoreElements() )
42 throw container::NoSuchElementException();
43 OUString sPath = *mIt++;
51 const css::uno::Reference< ov::XHelperInterface >& xParent
52 ,
const css::uno::Reference< css::uno::XComponentContext >& xContext
53 ,std::vector< OUString >&& rItems)
55 , m_sItems(
std::move(rItems)) {}
65uno::Reference< container::XEnumeration >
68 return uno::Reference< container::XEnumeration >(
new FileDialogItemEnumeration( std::vector(
m_sItems) ) );
74 sal_Int32 nPosition = -1;
75 if (!(aSource >>= nPosition))
76 throw uno::RuntimeException(
"not an sal_Int32");
78 throw uno::RuntimeException(
"out of range");
80 OUString sPath =
m_sItems[nPosition];
88 sal_Int32 nPosition = -1;
93 if( nPosition < 0 || nPosition >=
getCount() )
95 throw uno::RuntimeException();
110 return "ScVbaFileDialogSelectedItems";
113uno::Sequence<OUString>
118 "ooo.vba.FileDialogSelectedItems"
const std::vector< OUString > m_sItems
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
ScVbaFileDialogSelectedItems(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, std::vector< OUString > &&sItems)
virtual css::uno::Any SAL_CALL Item(const css::uno::Any &Index, const css::uno::Any &) override
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Any createCollectionObject(const css::uno::Any &aSource) override
virtual css::uno::Type SAL_CALL getElementType() override
css::uno::Type const & get()
std::deque< AttacherIndex_Impl > aIndex
Sequence< OUString > aServiceNames
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
enumrange< T >::Iterator begin(enumrange< T >)