tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / vba / vbamenubar.cxx
blob994f1cc5e20cc6160f5f5e7ba29ac8b41505a0b5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #include "vbamenubar.hxx"
10 #include "vbamenus.hxx"
11 #include <ooo/vba/XCommandBarControls.hpp>
12 #include <utility>
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))
21 uno::Any SAL_CALL
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 );
33 OUString
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
46 return aServiceNames;
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */