1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 #include "vbamenubar.hxx"
10 #include "vbamenus.hxx"
11 #include <ooo/vba/XCommandBarControls.hpp>
14 using namespace com::sun::star
;
15 using namespace ooo::vba
;
17 ScVbaMenuBar::ScVbaMenuBar( const uno::Reference
< ov::XHelperInterface
>& rParent
, const uno::Reference
< uno::XComponentContext
>& rContext
, uno::Reference
< XCommandBar
> xCommandBar
) : MenuBar_BASE(rParent
, rContext
), m_xCommandBar(std::move(xCommandBar
))
22 ScVbaMenuBar::Menus( const uno::Any
& aIndex
)
24 uno::Reference
< XCommandBarControls
> xCommandBarControls( m_xCommandBar
->Controls( uno::Any() ), uno::UNO_QUERY_THROW
);
25 uno::Reference
< excel::XMenus
> xMenus( new ScVbaMenus( this, mxContext
, xCommandBarControls
) );
26 if( aIndex
.hasValue() )
28 return xMenus
->Item( aIndex
, uno::Any() );
30 return uno::Any( xMenus
);
34 ScVbaMenuBar::getServiceImplName()
36 return u
"ScVbaMenuBar"_ustr
;
39 uno::Sequence
<OUString
>
40 ScVbaMenuBar::getServiceNames()
42 static uno::Sequence
< OUString
> const aServiceNames
44 u
"ooo.vba.excel.MenuBar"_ustr
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */