tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / vba / vbamenu.cxx
blob831674120976efff0bf10868d2a77abd99cedb6b
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 */
10 #include "vbamenu.hxx"
11 #include "vbamenuitems.hxx"
12 #include <ooo/vba/XCommandBarControls.hpp>
13 #include <utility>
15 using namespace com::sun::star;
16 using namespace ooo::vba;
18 ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< XCommandBarControl > xCommandBarControl ) : Menu_BASE( rParent, rContext ), m_xCommandBarControl(std::move( xCommandBarControl ))
22 OUString SAL_CALL
23 ScVbaMenu::getCaption()
25 return m_xCommandBarControl->getCaption();
28 void SAL_CALL
29 ScVbaMenu::setCaption( const OUString& _caption )
31 m_xCommandBarControl->setCaption( _caption );
34 void SAL_CALL
35 ScVbaMenu::Delete( )
37 m_xCommandBarControl->Delete();
40 uno::Any SAL_CALL
41 ScVbaMenu::MenuItems( const uno::Any& aIndex )
43 uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
44 uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) );
45 if( aIndex.hasValue() )
47 return xMenuItems->Item( aIndex, uno::Any() );
49 return uno::Any( xMenuItems );
52 OUString
53 ScVbaMenu::getServiceImplName()
55 return u"ScVbaMenu"_ustr;
58 uno::Sequence<OUString>
59 ScVbaMenu::getServiceNames()
61 static uno::Sequence< OUString > const aServiceNames
63 u"ooo.vba.excel.Menu"_ustr
65 return aServiceNames;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */