LibreOffice Module sc (master) 1
vbamenubar.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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>
13
14using namespace com::sun::star;
15using namespace ooo::vba;
16
17ScVbaMenuBar::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))
18{
19}
20
21uno::Any SAL_CALL
23{
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() )
27 {
28 return xMenus->Item( aIndex, uno::Any() );
29 }
30 return uno::Any( xMenus );
31}
32
33OUString
35{
36 return "ScVbaMenuBar";
37}
38
39uno::Sequence<OUString>
41{
42 static uno::Sequence< OUString > const aServiceNames
43 {
44 "ooo.vba.excel.MenuBar"
45 };
46 return aServiceNames;
47}
48
49/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Reference< ov::XCommandBar > m_xCommandBar
Definition: vbamenubar.hxx:20
virtual OUString getServiceImplName() override
Definition: vbamenubar.cxx:34
virtual css::uno::Any SAL_CALL Menus(const css::uno::Any &aIndex) override
Definition: vbamenubar.cxx:22
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbamenubar.cxx:40
ScVbaMenuBar(const css::uno::Reference< ov::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< ov::XCommandBar > xCommandBar)
Definition: vbamenubar.cxx:17
std::deque< AttacherIndex_Impl > aIndex
Sequence< OUString > aServiceNames