21 #include <ooo/vba/word/WdListGalleryType.hpp>
33 explicit ListLevelsEnumWrapper(
SwVbaListLevels* pLevels ) : pListLevels( pLevels ), nIndex( 1 ) {}
34 virtual sal_Bool SAL_CALL hasMoreElements( )
override
36 return ( nIndex <= pListLevels->getCount() );
39 virtual uno::Any SAL_CALL nextElement( )
override
41 if ( nIndex <= pListLevels->getCount() )
43 throw container::NoSuchElementException();
55 sal_Int32 nGalleryType =
pListHelper->getGalleryType();
56 if( nGalleryType == word::WdListGalleryType::wdBulletGallery
57 || nGalleryType == word::WdListGalleryType::wdNumberGallery )
59 else if( nGalleryType == word::WdListGalleryType::wdOutlineNumberGallery )
67 if( !( Index1 >>= nIndex ) )
68 throw uno::RuntimeException();
69 if( nIndex <=0 || nIndex >
getCount() )
70 throw uno::RuntimeException(
"Index out of bounds" );
82 uno::Reference< container::XEnumeration >
85 return new ListLevelsEnumWrapper(
this );
97 return "SwVbaListLevels";
100 css::uno::Sequence<OUString>
103 static uno::Sequence< OUString >
const sNames
105 "ooo.vba.word.ListLevels"
::cppu::WeakImplHelper< css::container::XEnumeration > EnumerationHelper_BASE
exports com.sun.star. container
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
SwVbaListLevels(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, SwVbaListHelperRef const &pHelper)
css::uno::Type const & get()
virtual css::uno::Any createCollectionObject(const css::uno::Any &aSource) override
SwVbaListHelperRef pListHelper
css::uno::Reference< css::uno::XComponentContext > mxContext
std::shared_ptr< SwVbaListHelper > SwVbaListHelperRef
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL Item(const css::uno::Any &Index1, const css::uno::Any &) override
virtual OUString getServiceImplName() override
virtual ::sal_Int32 SAL_CALL getCount() override
virtual css::uno::Sequence< OUString > getServiceNames() override