12#include <ooo/vba/excel/XlSheetType.hpp>
13#include <ooo/vba/XCommandBars.hpp>
21class MenuBarEnumeration :
public ::cppu::WeakImplHelper< container::XEnumeration >
23 uno::Reference< XHelperInterface > m_xParent;
24 uno::Reference< uno::XComponentContext >
m_xContext;
25 uno::Reference< container::XEnumeration > m_xEnumeration;
28 MenuBarEnumeration( uno::Reference< XHelperInterface > xParent, uno::Reference< uno::XComponentContext > xContext, uno::Reference< container::XEnumeration > xEnumeration) : m_xParent(
std::move( xParent )),
m_xContext(
std::move( xContext )), m_xEnumeration(
std::move( xEnumeration ))
31 virtual sal_Bool SAL_CALL hasMoreElements()
override
33 return m_xEnumeration->hasMoreElements();
35 virtual uno::Any SAL_CALL nextElement()
override
38 if( !hasMoreElements() )
39 throw container::NoSuchElementException();
41 uno::Reference< XCommandBar > xCommandBar( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
42 uno::Reference< excel::XMenuBar > xMenuBar(
new ScVbaMenuBar( m_xParent, m_xContext, xCommandBar ) );
49ScVbaMenuBars::ScVbaMenuBars(
const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< XCommandBars > xCommandBars ) :
MenuBars_BASE( xParent, xContext,
uno::
Reference< container::XIndexAccess>() ), m_xCommandBars(
std::move( xCommandBars ))
64uno::Reference< container::XEnumeration >
67 uno::Reference< container::XEnumerationAccess > xEnumAccess(
m_xCommandBars, uno::UNO_QUERY_THROW );
68 return uno::Reference< container::XEnumeration >(
new MenuBarEnumeration(
this,
mxContext, xEnumAccess->createEnumeration() ) );
90 if(
nIndex == excel::XlSheetType::xlWorksheet )
93 aSource <<= OUString(
"Worksheet Menu Bar" );
94 uno::Reference< XCommandBar > xCommandBar(
m_xCommandBars->Item( aSource,
uno::Any() ), uno::UNO_QUERY_THROW );
99 throw uno::RuntimeException(
"Not implemented" );
106 return "ScVbaMenuBars";
109uno::Sequence<OUString>
114 "ooo.vba.excel.MenuBars"
Reference< XComponentContext > m_xContext
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Type const & get()
std::deque< AttacherIndex_Impl > aIndex
Sequence< OUString > aServiceNames