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/.
10 #include "vbamenu.hxx"
11 #include "vbamenuitems.hxx"
12 #include <ooo/vba/XCommandBarControls.hpp>
14 using namespace com::sun::star
;
15 using namespace ooo::vba
;
17 ScVbaMenu::ScVbaMenu( const uno::Reference
< ov::XHelperInterface
>& rParent
, const uno::Reference
< uno::XComponentContext
>& rContext
, const uno::Reference
< XCommandBarControl
>& rCommandBarControl
) : Menu_BASE( rParent
, rContext
), m_xCommandBarControl( rCommandBarControl
)
22 ScVbaMenu::getCaption()
24 return m_xCommandBarControl
->getCaption();
28 ScVbaMenu::setCaption( const OUString
& _caption
)
30 m_xCommandBarControl
->setCaption( _caption
);
36 m_xCommandBarControl
->Delete();
40 ScVbaMenu::MenuItems( const uno::Any
& aIndex
)
42 uno::Reference
< XCommandBarControls
> xCommandBarControls( m_xCommandBarControl
->Controls( uno::Any() ), uno::UNO_QUERY_THROW
);
43 uno::Reference
< excel::XMenuItems
> xMenuItems( new ScVbaMenuItems( this, mxContext
, xCommandBarControls
) );
44 if( aIndex
.hasValue() )
46 return xMenuItems
->Item( aIndex
, uno::Any() );
48 return uno::makeAny( xMenuItems
);
52 ScVbaMenu::getServiceImplName()
57 uno::Sequence
<OUString
>
58 ScVbaMenu::getServiceNames()
60 static uno::Sequence
< OUString
> const aServiceNames
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */